@learncard/openid4vc-plugin 0.0.1 → 0.1.0
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.
- package/dist/openid4vc-plugin.cjs.development.js +3124 -1129
- package/dist/openid4vc-plugin.cjs.development.js.map +4 -4
- package/dist/openid4vc-plugin.cjs.production.min.js +16 -11
- package/dist/openid4vc-plugin.cjs.production.min.js.map +4 -4
- package/dist/openid4vc-plugin.esm.js +3124 -1129
- package/dist/openid4vc-plugin.esm.js.map +4 -4
- package/package.json +5 -5
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
"use strict";var B4=Object.create;var qa=Object.defineProperty;var D4=Object.getOwnPropertyDescriptor;var q4=Object.getOwnPropertyNames;var M4=Object.getPrototypeOf,U4=Object.prototype.hasOwnProperty;var o=(t,e)=>qa(t,"name",{value:e,configurable:!0});var K=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),E1=(t,e)=>{for(var r in e)qa(t,r,{get:e[r],enumerable:!0})},P1=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of q4(e))!U4.call(t,i)&&i!==r&&qa(t,i,{get:()=>e[i],enumerable:!(n=D4(e,i))||n.enumerable});return t};var kr=(t,e,r)=>(r=t!=null?B4(M4(t)):{},P1(e||!t||!t.__esModule?qa(r,"default",{value:t,enumerable:!0}):r,t)),$4=t=>P1(qa({},"__esModule",{value:!0}),t);var Cw=K(()=>{"use strict";var kw;(function(t){(function(e){var r=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),n=i(t);typeof r.Reflect<"u"&&(n=i(r.Reflect,n)),e(n,r),typeof r.Reflect>"u"&&(r.Reflect=t);function i(c,d){return function(p,y){Object.defineProperty(c,p,{configurable:!0,writable:!0,value:y}),d&&d(p,y)}}o(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}o(s,"functionThis");function u(){try{return(0,eval)("(function() { return this; })()")}catch{}}o(u,"indirectEvalThis");function a(){return s()||u()}o(a,"sloppyModeThis")})(function(e,r){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",u=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!a&&!c,p={create:a?function(){return Wp(Object.create(null))}:c?function(){return Wp({__proto__:null})}:function(){return Wp({})},has:d?function(m,w){return n.call(m,w)}:function(m,w){return w in m},get:d?function(m,w){return n.call(m,w)?m[w]:void 0}:function(m,w){return m[w]}},y=Object.getPrototypeOf(Function),v=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:I4(),x=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:O4(),A=typeof WeakMap=="function"?WeakMap:R4(),B=i?Symbol.for("@reflect-metadata:registry"):void 0,I=rd(),J=Da(I);function de(m,w,_,E){if($(_)){if(!Ra(m))throw new TypeError;if(!vo(w))throw new TypeError;return _r(m,w)}else{if(!Ra(m))throw new TypeError;if(!le(w))throw new TypeError;if(!le(E)&&!$(E)&&!ft(E))throw new TypeError;return ft(E)&&(E=void 0),_=dt(_),Fr(m,w,_,E)}}o(de,"decorate"),e("decorate",de);function fe(m,w){function _(E,L){if(!le(E))throw new TypeError;if(!$(L)&&!td(L))throw new TypeError;Ar(m,w,E,L)}return o(_,"decorator"),_}o(fe,"metadata"),e("metadata",fe);function ve(m,w,_,E){if(!le(_))throw new TypeError;return $(E)||(E=dt(E)),Ar(m,w,_,E)}o(ve,"defineMetadata"),e("defineMetadata",ve);function Y(m,w,_){if(!le(w))throw new TypeError;return $(_)||(_=dt(_)),ct(m,w,_)}o(Y,"hasMetadata"),e("hasMetadata",Y);function ye(m,w,_){if(!le(w))throw new TypeError;return $(_)||(_=dt(_)),xr(m,w,_)}o(ye,"hasOwnMetadata"),e("hasOwnMetadata",ye);function ae(m,w,_){if(!le(w))throw new TypeError;return $(_)||(_=dt(_)),kn(m,w,_)}o(ae,"getMetadata"),e("getMetadata",ae);function Ne(m,w,_){if(!le(w))throw new TypeError;return $(_)||(_=dt(_)),li(m,w,_)}o(Ne,"getOwnMetadata"),e("getOwnMetadata",Ne);function xt(m,w){if(!le(m))throw new TypeError;return $(w)||(w=dt(w)),Cn(m,w)}o(xt,"getMetadataKeys"),e("getMetadataKeys",xt);function at(m,w){if(!le(m))throw new TypeError;return $(w)||(w=dt(w)),nr(m,w)}o(at,"getOwnMetadataKeys"),e("getOwnMetadataKeys",at);function Bt(m,w,_){if(!le(w))throw new TypeError;if($(_)||(_=dt(_)),!le(w))throw new TypeError;$(_)||(_=dt(_));var E=Dt(w,_,!1);return $(E)?!1:E.OrdinaryDeleteMetadata(m,w,_)}o(Bt,"deleteMetadata"),e("deleteMetadata",Bt);function _r(m,w){for(var _=m.length-1;_>=0;--_){var E=m[_],L=E(w);if(!$(L)&&!ft(L)){if(!vo(L))throw new TypeError;w=L}}return w}o(_r,"DecorateConstructor");function Fr(m,w,_,E){for(var L=m.length-1;L>=0;--L){var Be=m[L],We=Be(w,_,E);if(!$(We)&&!ft(We)){if(!le(We))throw new TypeError;E=We}}return E}o(Fr,"DecorateProperty");function ct(m,w,_){var E=xr(m,w,_);if(E)return!0;var L=xo(w);return ft(L)?!1:ct(m,L,_)}o(ct,"OrdinaryHasMetadata");function xr(m,w,_){var E=Dt(w,_,!1);return $(E)?!1:Kr(E.OrdinaryHasOwnMetadata(m,w,_))}o(xr,"OrdinaryHasOwnMetadata");function kn(m,w,_){var E=xr(m,w,_);if(E)return li(m,w,_);var L=xo(w);if(!ft(L))return kn(m,L,_)}o(kn,"OrdinaryGetMetadata");function li(m,w,_){var E=Dt(w,_,!1);if(!$(E))return E.OrdinaryGetOwnMetadata(m,w,_)}o(li,"OrdinaryGetOwnMetadata");function Ar(m,w,_,E){var L=Dt(_,E,!0);L.OrdinaryDefineOwnMetadata(m,w,_,E)}o(Ar,"OrdinaryDefineOwnMetadata");function Cn(m,w){var _=nr(m,w),E=xo(m);if(E===null)return _;var L=Cn(E,w);if(L.length<=0)return _;if(_.length<=0)return L;for(var Be=new x,We=[],oe=0,O=_;oe<O.length;oe++){var j=O[oe],D=Be.has(j);D||(Be.add(j),We.push(j))}for(var M=0,ue=L;M<ue.length;M++){var j=ue[M],D=Be.has(j);D||(Be.add(j),We.push(j))}return We}o(Cn,"OrdinaryMetadataKeys");function nr(m,w){var _=Dt(m,w,!1);return _?_.OrdinaryOwnMetadataKeys(m,w):[]}o(nr,"OrdinaryOwnMetadataKeys");function Se(m){if(m===null)return 1;switch(typeof m){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return m===null?1:6;default:return 6}}o(Se,"Type");function $(m){return m===void 0}o($,"IsUndefined");function ft(m){return m===null}o(ft,"IsNull");function ir(m){return typeof m=="symbol"}o(ir,"IsSymbol");function le(m){return typeof m=="object"?m!==null:typeof m=="function"}o(le,"IsObject");function or(m,w){switch(Se(m)){case 0:return m;case 1:return m;case 2:return m;case 3:return m;case 4:return m;case 5:return m}var _=w===3?"string":w===5?"number":"default",E=wo(m,s);if(E!==void 0){var L=E.call(m,_);if(le(L))throw new TypeError;return L}return Sr(m,_==="default"?"number":_)}o(or,"ToPrimitive");function Sr(m,w){if(w==="string"){var _=m.toString;if(En(_)){var E=_.call(m);if(!le(E))return E}var L=m.valueOf;if(En(L)){var E=L.call(m);if(!le(E))return E}}else{var L=m.valueOf;if(En(L)){var E=L.call(m);if(!le(E))return E}var Be=m.toString;if(En(Be)){var E=Be.call(m);if(!le(E))return E}}throw new TypeError}o(Sr,"OrdinaryToPrimitive");function Kr(m){return!!m}o(Kr,"ToBoolean");function sr(m){return""+m}o(sr,"ToString");function dt(m){var w=or(m,3);return ir(w)?w:sr(w)}o(dt,"ToPropertyKey");function Ra(m){return Array.isArray?Array.isArray(m):m instanceof Object?m instanceof Array:Object.prototype.toString.call(m)==="[object Array]"}o(Ra,"IsArray");function En(m){return typeof m=="function"}o(En,"IsCallable");function vo(m){return typeof m=="function"}o(vo,"IsConstructor");function td(m){switch(Se(m)){case 3:return!0;case 4:return!0;default:return!1}}o(td,"IsPropertyKey");function bo(m,w){return m===w||m!==m&&w!==w}o(bo,"SameValueZero");function wo(m,w){var _=m[w];if(_!=null){if(!En(_))throw new TypeError;return _}}o(wo,"GetMethod");function ja(m){var w=wo(m,u);if(!En(w))throw new TypeError;var _=w.call(m);if(!le(_))throw new TypeError;return _}o(ja,"GetIterator");function Pn(m){return m.value}o(Pn,"IteratorValue");function _o(m){var w=m.next();return w.done?!1:w}o(_o,"IteratorStep");function Na(m){var w=m.return;w&&w.call(m)}o(Na,"IteratorClose");function xo(m){var w=Object.getPrototypeOf(m);if(typeof m!="function"||m===y||w!==y)return w;var _=m.prototype,E=_&&Object.getPrototypeOf(_);if(E==null||E===Object.prototype)return w;var L=E.constructor;return typeof L!="function"||L===m?w:L}o(xo,"OrdinaryGetPrototypeOf");function Ba(){var m;!$(B)&&typeof r.Reflect<"u"&&!(B in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(m=Lp(r.Reflect));var w,_,E,L=new A,Be={registerProvider:We,getProvider:O,setProvider:D};return Be;function We(M){if(!Object.isExtensible(Be))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case m===M:break;case $(w):w=M;break;case w===M:break;case $(_):_=M;break;case _===M:break;default:E===void 0&&(E=new x),E.add(M);break}}function oe(M,ue){if(!$(w)){if(w.isProviderFor(M,ue))return w;if(!$(_)){if(_.isProviderFor(M,ue))return w;if(!$(E))for(var we=ja(E);;){var De=_o(we);if(!De)return;var ur=Pn(De);if(ur.isProviderFor(M,ue))return Na(we),ur}}}if(!$(m)&&m.isProviderFor(M,ue))return m}function O(M,ue){var we=L.get(M),De;return $(we)||(De=we.get(ue)),$(De)&&(De=oe(M,ue),$(De)||($(we)&&(we=new v,L.set(M,we)),we.set(ue,De))),De}function j(M){if($(M))throw new TypeError;return w===M||_===M||!$(E)&&E.has(M)}function D(M,ue,we){if(!j(we))throw new Error("Metadata provider not registered.");var De=O(M,ue);if(De!==we){if(!$(De))return!1;var ur=L.get(M);$(ur)&&(ur=new v,L.set(M,ur)),ur.set(ue,we)}return!0}}o(Ba,"CreateMetadataRegistry");function rd(){var m;return!$(B)&&le(r.Reflect)&&Object.isExtensible(r.Reflect)&&(m=r.Reflect[B]),$(m)&&(m=Ba()),!$(B)&&le(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,B,{enumerable:!1,configurable:!1,writable:!1,value:m}),m}o(rd,"GetOrCreateMetadataRegistry");function Da(m){var w=new A,_={isProviderFor:o(function(j,D){var M=w.get(j);return $(M)?!1:M.has(D)},"isProviderFor"),OrdinaryDefineOwnMetadata:We,OrdinaryHasOwnMetadata:L,OrdinaryGetOwnMetadata:Be,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:O};return I.registerProvider(_),_;function E(j,D,M){var ue=w.get(j),we=!1;if($(ue)){if(!M)return;ue=new v,w.set(j,ue),we=!0}var De=ue.get(D);if($(De)){if(!M)return;if(De=new v,ue.set(D,De),!m.setProvider(j,D,_))throw ue.delete(D),we&&w.delete(j),new Error("Wrong provider for target.")}return De}o(E,"GetOrCreateMetadataMap");function L(j,D,M){var ue=E(D,M,!1);return $(ue)?!1:Kr(ue.has(j))}o(L,"OrdinaryHasOwnMetadata");function Be(j,D,M){var ue=E(D,M,!1);if(!$(ue))return ue.get(j)}o(Be,"OrdinaryGetOwnMetadata");function We(j,D,M,ue){var we=E(M,ue,!0);we.set(j,D)}o(We,"OrdinaryDefineOwnMetadata");function oe(j,D){var M=[],ue=E(j,D,!1);if($(ue))return M;for(var we=ue.keys(),De=ja(we),ur=0;;){var C1=_o(De);if(!C1)return M.length=ur,M;var j4=Pn(C1);try{M[ur]=j4}catch(N4){try{Na(De)}finally{throw N4}}ur++}}o(oe,"OrdinaryOwnMetadataKeys");function O(j,D,M){var ue=E(D,M,!1);if($(ue)||!ue.delete(j))return!1;if(ue.size===0){var we=w.get(D);$(we)||(we.delete(M),we.size===0&&w.delete(we))}return!0}o(O,"OrdinaryDeleteMetadata")}o(Da,"CreateMetadataProvider");function Lp(m){var w=m.defineMetadata,_=m.hasOwnMetadata,E=m.getOwnMetadata,L=m.getOwnMetadataKeys,Be=m.deleteMetadata,We=new A,oe={isProviderFor:o(function(O,j){var D=We.get(O);return!$(D)&&D.has(j)?!0:L(O,j).length?($(D)&&(D=new x,We.set(O,D)),D.add(j),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:w,OrdinaryHasOwnMetadata:_,OrdinaryGetOwnMetadata:E,OrdinaryOwnMetadataKeys:L,OrdinaryDeleteMetadata:Be};return oe}o(Lp,"CreateFallbackProvider");function Dt(m,w,_){var E=I.getProvider(m,w);if(!$(E))return E;if(_){if(I.setProvider(m,w,J))return J;throw new Error("Illegal state.")}}o(Dt,"GetMetadataProvider");function I4(){var m={},w=[],_=(function(){function oe(O,j,D){this._index=0,this._keys=O,this._values=j,this._selector=D}return o(oe,"MapIterator"),oe.prototype["@@iterator"]=function(){return this},oe.prototype[u]=function(){return this},oe.prototype.next=function(){var O=this._index;if(O>=0&&O<this._keys.length){var j=this._selector(this._keys[O],this._values[O]);return O+1>=this._keys.length?(this._index=-1,this._keys=w,this._values=w):this._index++,{value:j,done:!1}}return{value:void 0,done:!0}},oe.prototype.throw=function(O){throw this._index>=0&&(this._index=-1,this._keys=w,this._values=w),O},oe.prototype.return=function(O){return this._index>=0&&(this._index=-1,this._keys=w,this._values=w),{value:O,done:!0}},oe})(),E=(function(){function oe(){this._keys=[],this._values=[],this._cacheKey=m,this._cacheIndex=-2}return o(oe,"Map"),Object.defineProperty(oe.prototype,"size",{get:o(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),oe.prototype.has=function(O){return this._find(O,!1)>=0},oe.prototype.get=function(O){var j=this._find(O,!1);return j>=0?this._values[j]:void 0},oe.prototype.set=function(O,j){var D=this._find(O,!0);return this._values[D]=j,this},oe.prototype.delete=function(O){var j=this._find(O,!1);if(j>=0){for(var D=this._keys.length,M=j+1;M<D;M++)this._keys[M-1]=this._keys[M],this._values[M-1]=this._values[M];return this._keys.length--,this._values.length--,bo(O,this._cacheKey)&&(this._cacheKey=m,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=m,this._cacheIndex=-2},oe.prototype.keys=function(){return new _(this._keys,this._values,L)},oe.prototype.values=function(){return new _(this._keys,this._values,Be)},oe.prototype.entries=function(){return new _(this._keys,this._values,We)},oe.prototype["@@iterator"]=function(){return this.entries()},oe.prototype[u]=function(){return this.entries()},oe.prototype._find=function(O,j){if(!bo(this._cacheKey,O)){this._cacheIndex=-1;for(var D=0;D<this._keys.length;D++)if(bo(this._keys[D],O)){this._cacheIndex=D;break}}return this._cacheIndex<0&&j&&(this._cacheIndex=this._keys.length,this._keys.push(O),this._values.push(void 0)),this._cacheIndex},oe})();return E;function L(oe,O){return oe}function Be(oe,O){return O}function We(oe,O){return[oe,O]}}o(I4,"CreateMapPolyfill");function O4(){var m=(function(){function w(){this._map=new v}return o(w,"Set"),Object.defineProperty(w.prototype,"size",{get:o(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),w.prototype.has=function(_){return this._map.has(_)},w.prototype.add=function(_){return this._map.set(_,_),this},w.prototype.delete=function(_){return this._map.delete(_)},w.prototype.clear=function(){this._map.clear()},w.prototype.keys=function(){return this._map.keys()},w.prototype.values=function(){return this._map.keys()},w.prototype.entries=function(){return this._map.entries()},w.prototype["@@iterator"]=function(){return this.keys()},w.prototype[u]=function(){return this.keys()},w})();return m}o(O4,"CreateSetPolyfill");function R4(){var m=16,w=p.create(),_=E();return(function(){function O(){this._key=E()}return o(O,"WeakMap"),O.prototype.has=function(j){var D=L(j,!1);return D!==void 0?p.has(D,this._key):!1},O.prototype.get=function(j){var D=L(j,!1);return D!==void 0?p.get(D,this._key):void 0},O.prototype.set=function(j,D){var M=L(j,!0);return M[this._key]=D,this},O.prototype.delete=function(j){var D=L(j,!1);return D!==void 0?delete D[this._key]:!1},O.prototype.clear=function(){this._key=E()},O})();function E(){var O;do O="@@WeakMap@@"+oe();while(p.has(w,O));return w[O]=!0,O}function L(O,j){if(!n.call(O,_)){if(!j)return;Object.defineProperty(O,_,{value:p.create()})}return O[_]}function Be(O,j){for(var D=0;D<j;++D)O[D]=Math.random()*255|0;return O}function We(O){if(typeof Uint8Array=="function"){var j=new Uint8Array(O);return typeof crypto<"u"?crypto.getRandomValues(j):typeof msCrypto<"u"?msCrypto.getRandomValues(j):Be(j,O),j}return Be(new Array(O),O)}function oe(){var O=We(m);O[6]=O[6]&79|64,O[8]=O[8]&191|128;for(var j="",D=0;D<m;++D){var M=O[D];(D===4||D===6||D===8)&&(j+="-"),M<16&&(j+="0"),j+=M.toString(16).toLowerCase()}return j}}o(R4,"CreateWeakMapPolyfill");function Wp(m){return m.__=void 0,delete m.__,m}o(Wp,"MakeDictionary")})})(kw||(kw={}))});var Qr=K(Ro=>{"use strict";var u5="[object ArrayBuffer]",Ya=class Ya{static isArrayBuffer(e){return Object.prototype.toString.call(e)===u5}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,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(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,r){let n=Ya.toUint8Array(e),i=Ya.toUint8Array(r);if(n.length!==i.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let n=0;for(let u of r)n+=u.byteLength;let i=new Uint8Array(n),s=0;for(let u of r){let a=this.toUint8Array(u);i.set(a,s),s+=a.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}};o(Ya,"BufferSourceConverter");var Zr=Ya,Wh="string",a5=/^[0-9a-f\s]+$/i,c5=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f5=/^[a-zA-Z0-9-_]+$/,Fh=class Fh{static fromString(e){let r=unescape(encodeURIComponent(e)),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n.buffer}static toString(e){let r=Zr.toUint8Array(e),n="";for(let s=0;s<r.length;s++)n+=String.fromCharCode(r[s]);return decodeURIComponent(escape(n))}};o(Fh,"Utf8Converter");var Sd=Fh,Kh=class Kh{static toString(e,r=!1){let n=Zr.toArrayBuffer(e),i=new DataView(n),s="";for(let u=0;u<n.byteLength;u+=2){let a=i.getUint16(u,r);s+=String.fromCharCode(a)}return s}static fromString(e,r=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let s=0;s<e.length;s++)i.setUint16(s*2,e.charCodeAt(s),r);return n}};o(Kh,"Utf16Converter");var Jt=Kh,Rn=class Rn{static isHex(e){return typeof e===Wh&&a5.test(e)}static isBase64(e){return typeof e===Wh&&c5.test(e)}static isBase64Url(e){return typeof e===Wh&&f5.test(e)}static ToString(e,r="utf8"){let n=Zr.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Jt.toString(n,!0);case"utf16":case"utf16be":return Jt.toString(n);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.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 Jt.fromString(e,!0);case"utf16":case"utf16be":return Jt.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){let r=Zr.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(r,"binary");return btoa(n)}else return Buffer.from(r).toString("base64")}static FromBase64(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!Rn.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!Rn.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=Rn.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(e);case"utf8":return Sd.fromString(e);case"utf16":case"utf16be":return Jt.fromString(e);case"utf16le":case"usc2":return Jt.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=Rn.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(e);case"utf8":return Sd.toString(e);case"utf16":case"utf16be":return Jt.toString(e);case"utf16le":case"usc2":return Jt.toString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){let r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let r=Zr.toUint8Array(e),n="";for(let i=0;i<r.length;i++)n+=String.fromCharCode(r[i]);return n}static ToHex(e){let r=Zr.toUint8Array(e),n="",i=r.length;for(let s=0;s<i;s++){let u=r[s];u<16&&(n+="0"),n+=u.toString(16)}return n}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!Rn.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);let n=new Uint8Array(r.length/2);for(let i=0;i<r.length;i=i+2){let s=r.slice(i,i+2);n[i/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,r=!1){return Jt.toString(e,r)}static FromUtf16String(e,r=!1){return Jt.fromString(e,r)}static Base64Padding(e){let r=4-e.length%4;if(r<4)for(let n=0;n<r;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};o(Rn,"Convert");var kd=Rn;kd.DEFAULT_UTF8_ENCODING="utf8";function d5(t,...e){let r=arguments[0];for(let n=1;n<arguments.length;n++){let i=arguments[n];for(let s in i)r[s]=i[s]}return r}o(d5,"assign");function l5(...t){let e=t.map(i=>i.byteLength).reduce((i,s)=>i+s),r=new Uint8Array(e),n=0;return t.map(i=>new Uint8Array(i)).forEach(i=>{for(let s of i)r[n++]=s}),r.buffer}o(l5,"combine");function p5(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)if(r[i]!==n[i])return!1;return!0}o(p5,"isEqual");Ro.BufferSourceConverter=Zr;Ro.Convert=kd;Ro.assign=d5;Ro.combine=l5;Ro.isEqual=p5});var Nb=K((JZ,Ob)=>{"use strict";var Rb=class Rb{constructor(e){this.heuristic_replimit=e}};o(Rb,"AnalyzerOptions");var Tb=Rb,jb=class jb{constructor(e){this.options=e}isVulnerable(e){return!1}genAttackString(e){return null}};o(jb,"Analyzer");var Ib=jb;Ob.exports=function(t,e){let r=null,n=null;try{t instanceof RegExp?r=t:typeof t=="string"?r=new RegExp(t):r=new RegExp(String(t)),n=regexpTree.parse(r)}catch{return!1}let i=0,s=0,u=0;return regexpTree.traverse(n,{Repetition:{pre({node:a}){u++,i++,s<i&&(s=i)},post({node:a}){i--}}}),s<=1&&u<=e};Ob.exports={AnalyzerOptions:Tb,Analyzer:Ib}});var Gx=K((GZ,zx)=>{"use strict";zx.exports={_hasUFlag:!1,shouldRun:o(function(e){var r=e.flags.includes("s");return r?(e.flags=e.flags.replace("s",""),this._hasUFlag=e.flags.includes("u"),!0):!1},"shouldRun"),Char:o(function(e){var r=e.node;if(!(r.kind!=="meta"||r.value!==".")){var n="\\uFFFF",i="\uFFFF";this._hasUFlag&&(n="\\u{10FFFF}",i="\u{10FFFF}"),e.replace({type:"CharacterClass",expressions:[{type:"ClassRange",from:{type:"Char",value:"\\0",kind:"decimal",symbol:"\0"},to:{type:"Char",value:n,kind:"unicode",symbol:i}}]})}},"Char")}});var Zx=K((ZZ,Xx)=>{"use strict";Xx.exports={_groupNames:{},init:o(function(){this._groupNames={}},"init"),getExtra:o(function(){return this._groupNames},"getExtra"),Group:o(function(e){var r=e.node;r.name&&(this._groupNames[r.name]=r.number,delete r.name,delete r.nameRaw)},"Group"),Backreference:o(function(e){var r=e.node;r.kind==="name"&&(r.kind="number",r.reference=r.number,delete r.referenceRaw)},"Backreference")}});var Yx=K((YZ,Qx)=>{"use strict";Qx.exports={RegExp:o(function(e){var r=e.node;r.flags.includes("x")&&(r.flags=r.flags.replace("x",""))},"RegExp")}});var tA=K((tQ,eA)=>{"use strict";eA.exports={dotAll:Gx(),namedCapturingGroups:Zx(),xFlag:Yx()}});var Bb=K((rQ,rA)=>{"use strict";function Vt(t){return t?VC[t.type](t):""}o(Vt,"gen");var VC={RegExp:o(function(e){return"/"+Vt(e.body)+"/"+e.flags},"RegExp"),Alternative:o(function(e){return(e.expressions||[]).map(Vt).join("")},"Alternative"),Disjunction:o(function(e){return Vt(e.left)+"|"+Vt(e.right)},"Disjunction"),Group:o(function(e){var r=Vt(e.expression);return e.capturing?e.name?"(?<"+(e.nameRaw||e.name)+">"+r+")":"("+r+")":"(?:"+r+")"},"Group"),Backreference:o(function(e){switch(e.kind){case"number":return"\\"+e.reference;case"name":return"\\k<"+(e.referenceRaw||e.reference)+">";default:throw new TypeError("Unknown Backreference kind: "+e.kind)}},"Backreference"),Assertion:o(function(e){switch(e.kind){case"^":case"$":case"\\b":case"\\B":return e.kind;case"Lookahead":{var r=Vt(e.assertion);return e.negative?"(?!"+r+")":"(?="+r+")"}case"Lookbehind":{var n=Vt(e.assertion);return e.negative?"(?<!"+n+")":"(?<="+n+")"}default:throw new TypeError("Unknown Assertion kind: "+e.kind)}},"Assertion"),CharacterClass:o(function(e){var r=e.expressions.map(Vt).join("");return e.negative?"[^"+r+"]":"["+r+"]"},"CharacterClass"),ClassRange:o(function(e){return Vt(e.from)+"-"+Vt(e.to)},"ClassRange"),Repetition:o(function(e){return""+Vt(e.expression)+Vt(e.quantifier)},"Repetition"),Quantifier:o(function(e){var r=void 0,n=e.greedy?"":"?";switch(e.kind){case"+":case"?":case"*":r=e.kind;break;case"Range":e.from===e.to?r="{"+e.from+"}":e.to?r="{"+e.from+","+e.to+"}":r="{"+e.from+",}";break;default:throw new TypeError("Unknown Quantifier kind: "+e.kind)}return""+r+n},"Quantifier"),Char:o(function(e){var r=e.value;switch(e.kind){case"simple":return e.escaped?"\\"+r:r;case"hex":case"unicode":case"oct":case"decimal":case"control":case"meta":return r;default:throw new TypeError("Unknown Char kind: "+e.kind)}},"Char"),UnicodeProperty:o(function(e){var r=e.negative?"P":"p",n=void 0;return!e.shorthand&&!e.binary?n=e.name+"=":n="","\\"+r+"{"+n+e.value+"}"},"UnicodeProperty")};rA.exports={generate:Vt}});var sA=K((iQ,oA)=>{"use strict";var Db={General_Category:"gc",Script:"sc",Script_Extensions:"scx"},Ff=mp(Db),yp={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"},ci=mp(yp),qb={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"},pp=mp(qb),Mb={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"},hp=mp(Mb);function mp(t){var e={};for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];if(Array.isArray(n))for(var i=0;i<n.length;i++)e[n[i]]=r;else e[n]=r}return e}o(mp,"inverseMap");function HC(t){return Db.hasOwnProperty(t)||Ff.hasOwnProperty(t)||yp.hasOwnProperty(t)||ci.hasOwnProperty(t)}o(HC,"isValidName");function LC(t,e){return FC(t)?nA(e):KC(t)?iA(e):!1}o(LC,"isValidValue");function WC(t){return Ff.hasOwnProperty(t)||ci.hasOwnProperty(t)}o(WC,"isAlias");function FC(t){return t==="General_Category"||t=="gc"}o(FC,"isGeneralCategoryName");function KC(t){return t==="Script"||t==="Script_Extensions"||t==="sc"||t==="scx"}o(KC,"isScriptCategoryName");function nA(t){return qb.hasOwnProperty(t)||pp.hasOwnProperty(t)}o(nA,"isGeneralCategoryValue");function iA(t){return Mb.hasOwnProperty(t)||hp.hasOwnProperty(t)}o(iA,"isScriptCategoryValue");function JC(t){return yp.hasOwnProperty(t)||ci.hasOwnProperty(t)}o(JC,"isBinaryPropertyName");function zC(t){return Ff.hasOwnProperty(t)?Ff[t]:ci.hasOwnProperty(t)?ci[t]:null}o(zC,"getCanonicalName");function GC(t){return pp.hasOwnProperty(t)?pp[t]:hp.hasOwnProperty(t)?hp[t]:ci.hasOwnProperty(t)?ci[t]:null}o(GC,"getCanonicalValue");oA.exports={isAlias:WC,isValidName:HC,isValidValue:LC,isGeneralCategoryValue:nA,isScriptCategoryValue:iA,isBinaryPropertyName:JC,getCanonicalName:zC,getCanonicalValue:GC,NON_BINARY_PROP_NAMES_TO_ALIASES:Db,NON_BINARY_ALIASES_TO_PROP_NAMES:Ff,BINARY_PROP_NAMES_TO_ALIASES:yp,BINARY_ALIASES_TO_PROP_NAMES:ci,GENERAL_CATEGORY_VALUE_TO_ALIASES:qb,GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES:pp,SCRIPT_VALUE_TO_ALIASES:Mb,SCRIPT_VALUE_ALIASES_TO_VALUE:hp}});var bA=K((sQ,vA)=>{"use strict";var XC=(function(){function t(e,r){var n=[],i=!0,s=!1,u=void 0;try{for(var a=e[Symbol.iterator](),c;!(i=(c=a.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(d){s=!0,u=d}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return n}return o(t,"sliceIterator"),function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();function lA(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(lA,"_toConsumableArray");var Wr=void 0,pA=void 0,Le={},T=void 0,S=void 0;function q(t,e){return Le.options.captureLocations?!t||!e?t||e:{startOffset:t.startOffset,endOffset:e.endOffset,startLine:t.startLine,endLine:e.endLine,startColumn:t.startColumn,endColumn:e.endColumn}:null}o(q,"yyloc");var hA="$",ZC=[[-1,1,function(t,e){S=q(e,e),T=t}],[0,4,function(t,e,r,n,i,s,u,a){S=q(i,a),T=Pe({type:"RegExp",body:e,flags:r8(n)},gp(i,a||u))}],[1,1,function(t,e){S=q(e,e),T=t}],[1,0,function(){S=null,T=""}],[2,1,function(t,e){S=q(e,e),T=t}],[2,2,function(t,e,r,n){S=q(r,n),T=t+e}],[3,1,function(t,e){S=q(e,e),T=t}],[4,1,function(t,e){S=q(e,e),T=t}],[4,3,function(t,e,r,n,i,s){S=q(n,s);var u=null;i&&(u=gp(n||i,s||i)),T=Pe({type:"Disjunction",left:t,right:r},u)}],[5,1,function(t,e){if(S=q(e,e),t.length===0){T=null;return}t.length===1?T=Pe(t[0],S):T=Pe({type:"Alternative",expressions:t},S)}],[6,0,function(){S=null,T=[]}],[6,2,function(t,e,r,n){S=q(r,n),T=t.concat(e)}],[7,1,function(t,e){S=q(e,e),T=Pe(Object.assign({type:"Assertion"},t),S)}],[7,2,function(t,e,r,n){S=q(r,n),T=t,e&&(T=Pe({type:"Repetition",expression:t,quantifier:e},S))}],[8,1,function(t,e){S=q(e,e),T={kind:"^"}}],[8,1,function(t,e){S=q(e,e),T={kind:"$"}}],[8,1,function(t,e){S=q(e,e),T={kind:"\\b"}}],[8,1,function(t,e){S=q(e,e),T={kind:"\\B"}}],[8,3,function(t,e,r,n,i,s){S=q(n,s),T={kind:"Lookahead",assertion:e}}],[8,3,function(t,e,r,n,i,s){S=q(n,s),T={kind:"Lookahead",negative:!0,assertion:e}}],[8,3,function(t,e,r,n,i,s){S=q(n,s),T={kind:"Lookbehind",assertion:e}}],[8,3,function(t,e,r,n,i,s){S=q(n,s),T={kind:"Lookbehind",negative:!0,assertion:e}}],[9,1,function(t,e){S=q(e,e),T=t}],[9,1,function(t,e){S=q(e,e),T=t}],[9,1,function(t,e){S=q(e,e),T=t}],[10,1,function(t,e){S=q(e,e),T=_t(t,"simple",S)}],[10,1,function(t,e){S=q(e,e),T=_t(t.slice(1),"simple",S),T.escaped=!0}],[10,1,function(t,e){S=q(e,e),T=_t(t,"unicode",S),T.isSurrogatePair=!0}],[10,1,function(t,e){S=q(e,e),T=_t(t,"unicode",S)}],[10,1,function(t,e){S=q(e,e),T=e8(t,S)}],[10,1,function(t,e){S=q(e,e),T=_t(t,"control",S)}],[10,1,function(t,e){S=q(e,e),T=_t(t,"hex",S)}],[10,1,function(t,e){S=q(e,e),T=_t(t,"oct",S)}],[10,1,function(t,e){S=q(e,e),T=n8(t,S)}],[10,1,function(t,e){S=q(e,e),T=_t(t,"meta",S)}],[10,1,function(t,e){S=q(e,e),T=_t(t,"meta",S)}],[10,1,function(t,e){S=q(e,e),T=a8(t,e)}],[11,1,function(t,e){S=q(e,e),T=t}],[11,0],[12,1,function(t,e){S=q(e,e),T=t}],[12,2,function(t,e,r,n){S=q(r,n),t.greedy=!1,T=t}],[13,1,function(t,e){S=q(e,e),T=Pe({type:"Quantifier",kind:t,greedy:!0},S)}],[13,1,function(t,e){S=q(e,e),T=Pe({type:"Quantifier",kind:t,greedy:!0},S)}],[13,1,function(t,e){S=q(e,e),T=Pe({type:"Quantifier",kind:t,greedy:!0},S)}],[13,1,function(t,e){S=q(e,e);var r=$b(t);T=Pe({type:"Quantifier",kind:"Range",from:r[0],to:r[0],greedy:!0},S)}],[13,1,function(t,e){S=q(e,e),T=Pe({type:"Quantifier",kind:"Range",from:$b(t)[0],greedy:!0},S)}],[13,1,function(t,e){S=q(e,e);var r=$b(t);T=Pe({type:"Quantifier",kind:"Range",from:r[0],to:r[1],greedy:!0},S)}],[14,1,function(t,e){S=q(e,e),T=t}],[14,1,function(t,e){S=q(e,e),T=t}],[15,3,function(t,e,r,n,i,s){S=q(n,s);var u=String(t),a=mA(u);if(!Le.options.allowGroupNameDuplicates&&Kf.hasOwnProperty(a))throw new SyntaxError('Duplicate of the named group "'+a+'".');Kf[a]=t.groupNumber,T=Pe({type:"Group",capturing:!0,name:a,nameRaw:u,number:t.groupNumber,expression:e},S)}],[15,3,function(t,e,r,n,i,s){S=q(n,s),T=Pe({type:"Group",capturing:!0,number:t.groupNumber,expression:e},S)}],[16,3,function(t,e,r,n,i,s){S=q(n,s),T=Pe({type:"Group",capturing:!1,expression:e},S)}],[17,3,function(t,e,r,n,i,s){S=q(n,s),T=Pe({type:"CharacterClass",negative:!0,expressions:e},S)}],[17,3,function(t,e,r,n,i,s){S=q(n,s),T=Pe({type:"CharacterClass",expressions:e},S)}],[18,0,function(){S=null,T=[]}],[18,1,function(t,e){S=q(e,e),T=t}],[19,1,function(t,e){S=q(e,e),T=[t]}],[19,2,function(t,e,r,n){S=q(r,n),T=[t].concat(e)}],[19,4,function(t,e,r,n,i,s,u,a){S=q(i,a),cA(t,r),T=[Pe({type:"ClassRange",from:t,to:r},gp(i,u))],n&&(T=T.concat(n))}],[20,1,function(t,e){S=q(e,e),T=t}],[20,2,function(t,e,r,n){S=q(r,n),T=[t].concat(e)}],[20,4,function(t,e,r,n,i,s,u,a){S=q(i,a),cA(t,r),T=[Pe({type:"ClassRange",from:t,to:r},gp(i,u))],n&&(T=T.concat(n))}],[21,1,function(t,e){S=q(e,e),T=_t(t,"simple",S)}],[21,1,function(t,e){S=q(e,e),T=t}],[22,1,function(t,e){S=q(e,e),T=t}],[22,1,function(t,e){S=q(e,e),T=_t(t,"meta",S)}]],uA={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"},Ub=[{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"}],wt=[],Ht=void 0,QC=[[/^#[^\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 t=Wr.slice(3,-1);return fA(t,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 t=this.getCurrentState();if(t==="u_class"&&Wr==="\\-")return"ESC_CHAR";if(t==="u"||t==="xu"||t==="u_class")throw new SyntaxError("invalid Unicode escape "+Wr);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 Wr=Wr.slice(3,-1),fA(Wr,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 t=this.getCurrentState();return this.pushState(t==="u"||t==="xu"?"u_class":"class"),"NEG_CLASS"}],[/^\[/,function(){var t=this.getCurrentState();return this.pushState(t==="u"||t==="xu"?"u_class":"class"),"L_BRACKET"}]],YC={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]},aA={type:hA,value:""};Ht={initString:o(function(e){return this._string=e,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"),getStates:o(function(){return this._states},"getStates"),getCurrentState:o(function(){return this._states[this._states.length-1]},"getCurrentState"),pushState:o(function(e){this._states.push(e)},"pushState"),begin:o(function(e){this.pushState(e)},"begin"),popState:o(function(){return this._states.length>1?this._states.pop():this._states[0]},"popState"),getNextToken:o(function(){if(this._tokensQueue.length>0)return this.onToken(this._toToken(this._tokensQueue.shift()));if(!this.hasMoreTokens())return this.onToken(aA);for(var e=this._string.slice(this._cursor),r=YC[this.getCurrentState()],n=0;n<r.length;n++){var i=r[n],s=QC[i],u=this._match(e,s[0]);if(e===""&&u===""&&this._cursor++,u!==null){Wr=u,pA=Wr.length;var a=s[1].call(this);if(!a)return this.getNextToken();if(Array.isArray(a)){var c=a.slice(1);if(a=a[0],c.length>0){var d;(d=this._tokensQueue).unshift.apply(d,lA(c))}}return this.onToken(this._toToken(a,Wr))}}if(this.isEOF())return this._cursor++,aA;this.throwUnexpectedToken(e[0],this._currentLine,this._currentColumn)},"getNextToken"),throwUnexpectedToken:o(function(e,r,n){var i=this._string.split(`
|
|
1
|
+
"use strict";var b4=Object.create;var Do=Object.defineProperty;var w4=Object.getOwnPropertyDescriptor;var _4=Object.getOwnPropertyNames;var x4=Object.getPrototypeOf,A4=Object.prototype.hasOwnProperty;var S4=(t,e,r)=>e in t?Do(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var o=(t,e)=>Do(t,"name",{value:e,configurable:!0});var K=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lh=(t,e)=>{for(var r in e)Do(t,r,{get:e[r],enumerable:!0})},ow=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _4(e))!A4.call(t,i)&&i!==r&&Do(t,i,{get:()=>e[i],enumerable:!(n=w4(e,i))||n.enumerable});return t};var Ui=(t,e,r)=>(r=t!=null?b4(x4(t)):{},ow(e||!t||!t.__esModule?Do(r,"default",{value:t,enumerable:!0}):r,t)),k4=t=>ow(Do({},"__esModule",{value:!0}),t);var l=(t,e,r)=>S4(t,typeof e!="symbol"?e+"":e,r);var n_=K(()=>{"use strict";var r_;(function(t){(function(e){var r=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),n=i(t);typeof r.Reflect<"u"&&(n=i(r.Reflect,n)),e(n,r),typeof r.Reflect>"u"&&(r.Reflect=t);function i(c,d){return function(h,y){Object.defineProperty(c,h,{configurable:!0,writable:!0,value:y}),d&&d(h,y)}}o(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}o(s,"functionThis");function u(){try{return(0,eval)("(function() { return this; })()")}catch{}}o(u,"indirectEvalThis");function a(){return s()||u()}o(a,"sloppyModeThis")})(function(e,r){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",u=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!a&&!c,h={create:a?function(){return dh(Object.create(null))}:c?function(){return dh({__proto__:null})}:function(){return dh({})},has:d?function(g,_){return n.call(g,_)}:function(g,_){return _ in g},get:d?function(g,_){return n.call(g,_)?g[_]:void 0}:function(g,_){return g[_]}},y=Object.getPrototypeOf(Function),b=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:h4(),A=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:y4(),S=typeof WeakMap=="function"?WeakMap:m4(),D=i?Symbol.for("@reflect-metadata:registry"):void 0,I=wd(),J=Za(I);function pe(g,_,x,P){if(V(x)){if(!Ka(g))throw new TypeError;if(!Oo(_))throw new TypeError;return Dr(g,_)}else{if(!Ka(g))throw new TypeError;if(!he(_))throw new TypeError;if(!he(P)&&!V(P)&&!vt(P))throw new TypeError;return vt(P)&&(P=void 0),x=bt(x),sn(g,_,x,P)}}o(pe,"decorate"),e("decorate",pe);function de(g,_){function x(P,H){if(!he(P))throw new TypeError;if(!V(H)&&!bd(H))throw new TypeError;Mr(g,_,P,H)}return o(x,"decorator"),x}o(de,"metadata"),e("metadata",de);function xe(g,_,x,P){if(!he(x))throw new TypeError;return V(P)||(P=bt(P)),Mr(g,_,x,P)}o(xe,"defineMetadata"),e("defineMetadata",xe);function ee(g,_,x){if(!he(_))throw new TypeError;return V(x)||(x=bt(x)),gt(g,_,x)}o(ee,"hasMetadata"),e("hasMetadata",ee);function ve(g,_,x){if(!he(_))throw new TypeError;return V(x)||(x=bt(x)),qr(g,_,x)}o(ve,"hasOwnMetadata"),e("hasOwnMetadata",ve);function ce(g,_,x){if(!he(_))throw new TypeError;return V(x)||(x=bt(x)),Xn(g,_,x)}o(ce,"getMetadata"),e("getMetadata",ce);function Ve(g,_,x){if(!he(_))throw new TypeError;return V(x)||(x=bt(x)),Mi(g,_,x)}o(Ve,"getOwnMetadata"),e("getOwnMetadata",Ve);function It(g,_){if(!he(g))throw new TypeError;return V(_)||(_=bt(_)),Zn(g,_)}o(It,"getMetadataKeys"),e("getMetadataKeys",It);function mt(g,_){if(!he(g))throw new TypeError;return V(_)||(_=bt(_)),br(g,_)}o(mt,"getOwnMetadataKeys"),e("getOwnMetadataKeys",mt);function Ft(g,_,x){if(!he(_))throw new TypeError;if(V(x)||(x=bt(x)),!he(_))throw new TypeError;V(x)||(x=bt(x));var P=zt(_,x,!1);return V(P)?!1:P.OrdinaryDeleteMetadata(g,_,x)}o(Ft,"deleteMetadata"),e("deleteMetadata",Ft);function Dr(g,_){for(var x=g.length-1;x>=0;--x){var P=g[x],H=P(_);if(!V(H)&&!vt(H)){if(!Oo(H))throw new TypeError;_=H}}return _}o(Dr,"DecorateConstructor");function sn(g,_,x,P){for(var H=g.length-1;H>=0;--H){var Le=g[H],Ge=Le(_,x,P);if(!V(Ge)&&!vt(Ge)){if(!he(Ge))throw new TypeError;P=Ge}}return P}o(sn,"DecorateProperty");function gt(g,_,x){var P=qr(g,_,x);if(P)return!0;var H=Bo(_);return vt(H)?!1:gt(g,H,x)}o(gt,"OrdinaryHasMetadata");function qr(g,_,x){var P=zt(_,x,!1);return V(P)?!1:un(P.OrdinaryHasOwnMetadata(g,_,x))}o(qr,"OrdinaryHasOwnMetadata");function Xn(g,_,x){var P=qr(g,_,x);if(P)return Mi(g,_,x);var H=Bo(_);if(!vt(H))return Xn(g,H,x)}o(Xn,"OrdinaryGetMetadata");function Mi(g,_,x){var P=zt(_,x,!1);if(!V(P))return P.OrdinaryGetOwnMetadata(g,_,x)}o(Mi,"OrdinaryGetOwnMetadata");function Mr(g,_,x,P){var H=zt(x,P,!0);H.OrdinaryDefineOwnMetadata(g,_,x,P)}o(Mr,"OrdinaryDefineOwnMetadata");function Zn(g,_){var x=br(g,_),P=Bo(g);if(P===null)return x;var H=Zn(P,_);if(H.length<=0)return x;if(x.length<=0)return H;for(var Le=new A,Ge=[],se=0,O=x;se<O.length;se++){var N=O[se],q=Le.has(N);q||(Le.add(N),Ge.push(N))}for(var U=0,ae=H;U<ae.length;U++){var N=ae[U],q=Le.has(N);q||(Le.add(N),Ge.push(N))}return Ge}o(Zn,"OrdinaryMetadataKeys");function br(g,_){var x=zt(g,_,!1);return x?x.OrdinaryOwnMetadataKeys(g,_):[]}o(br,"OrdinaryOwnMetadataKeys");function Te(g){if(g===null)return 1;switch(typeof g){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return g===null?1:6;default:return 6}}o(Te,"Type");function V(g){return g===void 0}o(V,"IsUndefined");function vt(g){return g===null}o(vt,"IsNull");function wr(g){return typeof g=="symbol"}o(wr,"IsSymbol");function he(g){return typeof g=="object"?g!==null:typeof g=="function"}o(he,"IsObject");function _r(g,_){switch(Te(g)){case 0:return g;case 1:return g;case 2:return g;case 3:return g;case 4:return g;case 5:return g}var x=_===3?"string":_===5?"number":"default",P=jo(g,s);if(P!==void 0){var H=P.call(g,x);if(he(H))throw new TypeError;return H}return Ur(g,x==="default"?"number":x)}o(_r,"ToPrimitive");function Ur(g,_){if(_==="string"){var x=g.toString;if(Qn(x)){var P=x.call(g);if(!he(P))return P}var H=g.valueOf;if(Qn(H)){var P=H.call(g);if(!he(P))return P}}else{var H=g.valueOf;if(Qn(H)){var P=H.call(g);if(!he(P))return P}var Le=g.toString;if(Qn(Le)){var P=Le.call(g);if(!he(P))return P}}throw new TypeError}o(Ur,"OrdinaryToPrimitive");function un(g){return!!g}o(un,"ToBoolean");function xr(g){return""+g}o(xr,"ToString");function bt(g){var _=_r(g,3);return wr(_)?_:xr(_)}o(bt,"ToPropertyKey");function Ka(g){return Array.isArray?Array.isArray(g):g instanceof Object?g instanceof Array:Object.prototype.toString.call(g)==="[object Array]"}o(Ka,"IsArray");function Qn(g){return typeof g=="function"}o(Qn,"IsCallable");function Oo(g){return typeof g=="function"}o(Oo,"IsConstructor");function bd(g){switch(Te(g)){case 3:return!0;case 4:return!0;default:return!1}}o(bd,"IsPropertyKey");function Ro(g,_){return g===_||g!==g&&_!==_}o(Ro,"SameValueZero");function jo(g,_){var x=g[_];if(x!=null){if(!Qn(x))throw new TypeError;return x}}o(jo,"GetMethod");function Ja(g){var _=jo(g,u);if(!Qn(_))throw new TypeError;var x=_.call(g);if(!he(x))throw new TypeError;return x}o(Ja,"GetIterator");function Yn(g){return g.value}o(Yn,"IteratorValue");function No(g){var _=g.next();return _.done?!1:_}o(No,"IteratorStep");function Ga(g){var _=g.return;_&&_.call(g)}o(Ga,"IteratorClose");function Bo(g){var _=Object.getPrototypeOf(g);if(typeof g!="function"||g===y||_!==y)return _;var x=g.prototype,P=x&&Object.getPrototypeOf(x);if(P==null||P===Object.prototype)return _;var H=P.constructor;return typeof H!="function"||H===g?_:H}o(Bo,"OrdinaryGetPrototypeOf");function Xa(){var g;!V(D)&&typeof r.Reflect<"u"&&!(D in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(g=fh(r.Reflect));var _,x,P,H=new S,Le={registerProvider:Ge,getProvider:O,setProvider:q};return Le;function Ge(U){if(!Object.isExtensible(Le))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case g===U:break;case V(_):_=U;break;case _===U:break;case V(x):x=U;break;case x===U:break;default:P===void 0&&(P=new A),P.add(U);break}}function se(U,ae){if(!V(_)){if(_.isProviderFor(U,ae))return _;if(!V(x)){if(x.isProviderFor(U,ae))return _;if(!V(P))for(var Se=Ja(P);;){var He=No(Se);if(!He)return;var Ar=Yn(He);if(Ar.isProviderFor(U,ae))return Ga(Se),Ar}}}if(!V(g)&&g.isProviderFor(U,ae))return g}function O(U,ae){var Se=H.get(U),He;return V(Se)||(He=Se.get(ae)),V(He)&&(He=se(U,ae),V(He)||(V(Se)&&(Se=new b,H.set(U,Se)),Se.set(ae,He))),He}function N(U){if(V(U))throw new TypeError;return _===U||x===U||!V(P)&&P.has(U)}function q(U,ae,Se){if(!N(Se))throw new Error("Metadata provider not registered.");var He=O(U,ae);if(He!==Se){if(!V(He))return!1;var Ar=H.get(U);V(Ar)&&(Ar=new b,H.set(U,Ar)),Ar.set(ae,Se)}return!0}}o(Xa,"CreateMetadataRegistry");function wd(){var g;return!V(D)&&he(r.Reflect)&&Object.isExtensible(r.Reflect)&&(g=r.Reflect[D]),V(g)&&(g=Xa()),!V(D)&&he(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,D,{enumerable:!1,configurable:!1,writable:!1,value:g}),g}o(wd,"GetOrCreateMetadataRegistry");function Za(g){var _=new S,x={isProviderFor:o(function(N,q){var U=_.get(N);return V(U)?!1:U.has(q)},"isProviderFor"),OrdinaryDefineOwnMetadata:Ge,OrdinaryHasOwnMetadata:H,OrdinaryGetOwnMetadata:Le,OrdinaryOwnMetadataKeys:se,OrdinaryDeleteMetadata:O};return I.registerProvider(x),x;function P(N,q,U){var ae=_.get(N),Se=!1;if(V(ae)){if(!U)return;ae=new b,_.set(N,ae),Se=!0}var He=ae.get(q);if(V(He)){if(!U)return;if(He=new b,ae.set(q,He),!g.setProvider(N,q,x))throw ae.delete(q),Se&&_.delete(N),new Error("Wrong provider for target.")}return He}o(P,"GetOrCreateMetadataMap");function H(N,q,U){var ae=P(q,U,!1);return V(ae)?!1:un(ae.has(N))}o(H,"OrdinaryHasOwnMetadata");function Le(N,q,U){var ae=P(q,U,!1);if(!V(ae))return ae.get(N)}o(Le,"OrdinaryGetOwnMetadata");function Ge(N,q,U,ae){var Se=P(U,ae,!0);Se.set(N,q)}o(Ge,"OrdinaryDefineOwnMetadata");function se(N,q){var U=[],ae=P(N,q,!1);if(V(ae))return U;for(var Se=ae.keys(),He=Ja(Se),Ar=0;;){var iw=No(He);if(!iw)return U.length=Ar,U;var g4=Yn(iw);try{U[Ar]=g4}catch(v4){try{Ga(He)}finally{throw v4}}Ar++}}o(se,"OrdinaryOwnMetadataKeys");function O(N,q,U){var ae=P(q,U,!1);if(V(ae)||!ae.delete(N))return!1;if(ae.size===0){var Se=_.get(q);V(Se)||(Se.delete(U),Se.size===0&&_.delete(Se))}return!0}o(O,"OrdinaryDeleteMetadata")}o(Za,"CreateMetadataProvider");function fh(g){var _=g.defineMetadata,x=g.hasOwnMetadata,P=g.getOwnMetadata,H=g.getOwnMetadataKeys,Le=g.deleteMetadata,Ge=new S,se={isProviderFor:o(function(O,N){var q=Ge.get(O);return!V(q)&&q.has(N)?!0:H(O,N).length?(V(q)&&(q=new A,Ge.set(O,q)),q.add(N),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:_,OrdinaryHasOwnMetadata:x,OrdinaryGetOwnMetadata:P,OrdinaryOwnMetadataKeys:H,OrdinaryDeleteMetadata:Le};return se}o(fh,"CreateFallbackProvider");function zt(g,_,x){var P=I.getProvider(g,_);if(!V(P))return P;if(x){if(I.setProvider(g,_,J))return J;throw new Error("Illegal state.")}}o(zt,"GetMetadataProvider");function h4(){var g={},_=[],x=(function(){function se(O,N,q){this._index=0,this._keys=O,this._values=N,this._selector=q}return o(se,"MapIterator"),se.prototype["@@iterator"]=function(){return this},se.prototype[u]=function(){return this},se.prototype.next=function(){var O=this._index;if(O>=0&&O<this._keys.length){var N=this._selector(this._keys[O],this._values[O]);return O+1>=this._keys.length?(this._index=-1,this._keys=_,this._values=_):this._index++,{value:N,done:!1}}return{value:void 0,done:!0}},se.prototype.throw=function(O){throw this._index>=0&&(this._index=-1,this._keys=_,this._values=_),O},se.prototype.return=function(O){return this._index>=0&&(this._index=-1,this._keys=_,this._values=_),{value:O,done:!0}},se})(),P=(function(){function se(){this._keys=[],this._values=[],this._cacheKey=g,this._cacheIndex=-2}return o(se,"Map"),Object.defineProperty(se.prototype,"size",{get:o(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),se.prototype.has=function(O){return this._find(O,!1)>=0},se.prototype.get=function(O){var N=this._find(O,!1);return N>=0?this._values[N]:void 0},se.prototype.set=function(O,N){var q=this._find(O,!0);return this._values[q]=N,this},se.prototype.delete=function(O){var N=this._find(O,!1);if(N>=0){for(var q=this._keys.length,U=N+1;U<q;U++)this._keys[U-1]=this._keys[U],this._values[U-1]=this._values[U];return this._keys.length--,this._values.length--,Ro(O,this._cacheKey)&&(this._cacheKey=g,this._cacheIndex=-2),!0}return!1},se.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=g,this._cacheIndex=-2},se.prototype.keys=function(){return new x(this._keys,this._values,H)},se.prototype.values=function(){return new x(this._keys,this._values,Le)},se.prototype.entries=function(){return new x(this._keys,this._values,Ge)},se.prototype["@@iterator"]=function(){return this.entries()},se.prototype[u]=function(){return this.entries()},se.prototype._find=function(O,N){if(!Ro(this._cacheKey,O)){this._cacheIndex=-1;for(var q=0;q<this._keys.length;q++)if(Ro(this._keys[q],O)){this._cacheIndex=q;break}}return this._cacheIndex<0&&N&&(this._cacheIndex=this._keys.length,this._keys.push(O),this._values.push(void 0)),this._cacheIndex},se})();return P;function H(se,O){return se}function Le(se,O){return O}function Ge(se,O){return[se,O]}}o(h4,"CreateMapPolyfill");function y4(){var g=(function(){function _(){this._map=new b}return o(_,"Set"),Object.defineProperty(_.prototype,"size",{get:o(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),_.prototype.has=function(x){return this._map.has(x)},_.prototype.add=function(x){return this._map.set(x,x),this},_.prototype.delete=function(x){return this._map.delete(x)},_.prototype.clear=function(){this._map.clear()},_.prototype.keys=function(){return this._map.keys()},_.prototype.values=function(){return this._map.keys()},_.prototype.entries=function(){return this._map.entries()},_.prototype["@@iterator"]=function(){return this.keys()},_.prototype[u]=function(){return this.keys()},_})();return g}o(y4,"CreateSetPolyfill");function m4(){var g=16,_=h.create(),x=P();return(function(){function O(){this._key=P()}return o(O,"WeakMap"),O.prototype.has=function(N){var q=H(N,!1);return q!==void 0?h.has(q,this._key):!1},O.prototype.get=function(N){var q=H(N,!1);return q!==void 0?h.get(q,this._key):void 0},O.prototype.set=function(N,q){var U=H(N,!0);return U[this._key]=q,this},O.prototype.delete=function(N){var q=H(N,!1);return q!==void 0?delete q[this._key]:!1},O.prototype.clear=function(){this._key=P()},O})();function P(){var O;do O="@@WeakMap@@"+se();while(h.has(_,O));return _[O]=!0,O}function H(O,N){if(!n.call(O,x)){if(!N)return;Object.defineProperty(O,x,{value:h.create()})}return O[x]}function Le(O,N){for(var q=0;q<N;++q)O[q]=Math.random()*255|0;return O}function Ge(O){if(typeof Uint8Array=="function"){var N=new Uint8Array(O);return typeof crypto<"u"?crypto.getRandomValues(N):typeof msCrypto<"u"?msCrypto.getRandomValues(N):Le(N,O),N}return Le(new Array(O),O)}function se(){var O=Ge(g);O[6]=O[6]&79|64,O[8]=O[8]&191|128;for(var N="",q=0;q<g;++q){var U=O[q];(q===4||q===6||q===8)&&(N+="-"),U<16&&(N+="0"),N+=U.toString(16).toLowerCase()}return N}}o(m4,"CreateWeakMapPolyfill");function dh(g){return g.__=void 0,delete g.__,g}o(dh,"MakeDictionary")})})(r_||(r_={}))});var Ko=K(zo=>{"use strict";var z5="[object ArrayBuffer]",pc=class pc{static isArrayBuffer(e){return Object.prototype.toString.call(e)===z5}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,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(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,r){let n=pc.toUint8Array(e),i=pc.toUint8Array(r);if(n.length!==i.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let n=0;for(let u of r)n+=u.byteLength;let i=new Uint8Array(n),s=0;for(let u of r){let a=this.toUint8Array(u);i.set(a,s),s+=a.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}};o(pc,"BufferSourceConverter");var ln=pc,ly="string",K5=/^[0-9a-f\s]+$/i,J5=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,G5=/^[a-zA-Z0-9-_]+$/,py=class py{static fromString(e){let r=unescape(encodeURIComponent(e)),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n.buffer}static toString(e){let r=ln.toUint8Array(e),n="";for(let s=0;s<r.length;s++)n+=String.fromCharCode(r[s]);return decodeURIComponent(escape(n))}};o(py,"Utf8Converter");var Ld=py,hy=class hy{static toString(e,r=!1){let n=ln.toArrayBuffer(e),i=new DataView(n),s="";for(let u=0;u<n.byteLength;u+=2){let a=i.getUint16(u,r);s+=String.fromCharCode(a)}return s}static fromString(e,r=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let s=0;s<e.length;s++)i.setUint16(s*2,e.charCodeAt(s),r);return n}};o(hy,"Utf16Converter");var ir=hy,ni=class ni{static isHex(e){return typeof e===ly&&K5.test(e)}static isBase64(e){return typeof e===ly&&J5.test(e)}static isBase64Url(e){return typeof e===ly&&G5.test(e)}static ToString(e,r="utf8"){let n=ln.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return ir.toString(n,!0);case"utf16":case"utf16be":return ir.toString(n);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.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 ir.fromString(e,!0);case"utf16":case"utf16be":return ir.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){let r=ln.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(r,"binary");return btoa(n)}else return Buffer.from(r).toString("base64")}static FromBase64(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!ni.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!ni.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=ni.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(e);case"utf8":return Ld.fromString(e);case"utf16":case"utf16be":return ir.fromString(e);case"utf16le":case"usc2":return ir.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=ni.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(e);case"utf8":return Ld.toString(e);case"utf16":case"utf16be":return ir.toString(e);case"utf16le":case"usc2":return ir.toString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){let r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let r=ln.toUint8Array(e),n="";for(let i=0;i<r.length;i++)n+=String.fromCharCode(r[i]);return n}static ToHex(e){let r=ln.toUint8Array(e),n="",i=r.length;for(let s=0;s<i;s++){let u=r[s];u<16&&(n+="0"),n+=u.toString(16)}return n}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!ni.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);let n=new Uint8Array(r.length/2);for(let i=0;i<r.length;i=i+2){let s=r.slice(i,i+2);n[i/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,r=!1){return ir.toString(e,r)}static FromUtf16String(e,r=!1){return ir.fromString(e,r)}static Base64Padding(e){let r=4-e.length%4;if(r<4)for(let n=0;n<r;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};o(ni,"Convert");var Hd=ni;Hd.DEFAULT_UTF8_ENCODING="utf8";function X5(t,...e){let r=arguments[0];for(let n=1;n<arguments.length;n++){let i=arguments[n];for(let s in i)r[s]=i[s]}return r}o(X5,"assign");function Z5(...t){let e=t.map(i=>i.byteLength).reduce((i,s)=>i+s),r=new Uint8Array(e),n=0;return t.map(i=>new Uint8Array(i)).forEach(i=>{for(let s of i)r[n++]=s}),r.buffer}o(Z5,"combine");function Q5(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)if(r[i]!==n[i])return!1;return!0}o(Q5,"isEqual");zo.BufferSourceConverter=ln;zo.Convert=Hd;zo.assign=X5;zo.combine=Z5;zo.isEqual=Q5});var l1=K((Cte,c1)=>{"use strict";var f1=class f1{constructor(e){this.heuristic_replimit=e}};o(f1,"AnalyzerOptions");var u1=f1,d1=class d1{constructor(e){this.options=e}isVulnerable(e){return!1}genAttackString(e){return null}};o(d1,"Analyzer");var a1=d1;c1.exports=function(t,e){let r=null,n=null;try{t instanceof RegExp?r=t:typeof t=="string"?r=new RegExp(t):r=new RegExp(String(t)),n=regexpTree.parse(r)}catch{return!1}let i=0,s=0,u=0;return regexpTree.traverse(n,{Repetition:{pre({node:a}){u++,i++,s<i&&(s=i)},post({node:a}){i--}}}),s<=1&&u<=e};c1.exports={AnalyzerOptions:u1,Analyzer:a1}});var jA=K((Pte,RA)=>{"use strict";RA.exports={_hasUFlag:!1,shouldRun:o(function(e){var r=e.flags.includes("s");return r?(e.flags=e.flags.replace("s",""),this._hasUFlag=e.flags.includes("u"),!0):!1},"shouldRun"),Char:o(function(e){var r=e.node;if(!(r.kind!=="meta"||r.value!==".")){var n="\\uFFFF",i="\uFFFF";this._hasUFlag&&(n="\\u{10FFFF}",i="\u{10FFFF}"),e.replace({type:"CharacterClass",expressions:[{type:"ClassRange",from:{type:"Char",value:"\\0",kind:"decimal",symbol:"\0"},to:{type:"Char",value:n,kind:"unicode",symbol:i}}]})}},"Char")}});var BA=K((Ite,NA)=>{"use strict";NA.exports={_groupNames:{},init:o(function(){this._groupNames={}},"init"),getExtra:o(function(){return this._groupNames},"getExtra"),Group:o(function(e){var r=e.node;r.name&&(this._groupNames[r.name]=r.number,delete r.name,delete r.nameRaw)},"Group"),Backreference:o(function(e){var r=e.node;r.kind==="name"&&(r.kind="number",r.reference=r.number,delete r.referenceRaw)},"Backreference")}});var qA=K((Rte,DA)=>{"use strict";DA.exports={RegExp:o(function(e){var r=e.node;r.flags.includes("x")&&(r.flags=r.flags.replace("x",""))},"RegExp")}});var UA=K((Nte,MA)=>{"use strict";MA.exports={dotAll:jA(),namedCapturingGroups:BA(),xFlag:qA()}});var p1=K((Bte,$A)=>{"use strict";function Qt(t){return t?mE[t.type](t):""}o(Qt,"gen");var mE={RegExp:o(function(e){return"/"+Qt(e.body)+"/"+e.flags},"RegExp"),Alternative:o(function(e){return(e.expressions||[]).map(Qt).join("")},"Alternative"),Disjunction:o(function(e){return Qt(e.left)+"|"+Qt(e.right)},"Disjunction"),Group:o(function(e){var r=Qt(e.expression);return e.capturing?e.name?"(?<"+(e.nameRaw||e.name)+">"+r+")":"("+r+")":"(?:"+r+")"},"Group"),Backreference:o(function(e){switch(e.kind){case"number":return"\\"+e.reference;case"name":return"\\k<"+(e.referenceRaw||e.reference)+">";default:throw new TypeError("Unknown Backreference kind: "+e.kind)}},"Backreference"),Assertion:o(function(e){switch(e.kind){case"^":case"$":case"\\b":case"\\B":return e.kind;case"Lookahead":{var r=Qt(e.assertion);return e.negative?"(?!"+r+")":"(?="+r+")"}case"Lookbehind":{var n=Qt(e.assertion);return e.negative?"(?<!"+n+")":"(?<="+n+")"}default:throw new TypeError("Unknown Assertion kind: "+e.kind)}},"Assertion"),CharacterClass:o(function(e){var r=e.expressions.map(Qt).join("");return e.negative?"[^"+r+"]":"["+r+"]"},"CharacterClass"),ClassRange:o(function(e){return Qt(e.from)+"-"+Qt(e.to)},"ClassRange"),Repetition:o(function(e){return""+Qt(e.expression)+Qt(e.quantifier)},"Repetition"),Quantifier:o(function(e){var r=void 0,n=e.greedy?"":"?";switch(e.kind){case"+":case"?":case"*":r=e.kind;break;case"Range":e.from===e.to?r="{"+e.from+"}":e.to?r="{"+e.from+","+e.to+"}":r="{"+e.from+",}";break;default:throw new TypeError("Unknown Quantifier kind: "+e.kind)}return""+r+n},"Quantifier"),Char:o(function(e){var r=e.value;switch(e.kind){case"simple":return e.escaped?"\\"+r:r;case"hex":case"unicode":case"oct":case"decimal":case"control":case"meta":return r;default:throw new TypeError("Unknown Char kind: "+e.kind)}},"Char"),UnicodeProperty:o(function(e){var r=e.negative?"P":"p",n=void 0;return!e.shorthand&&!e.binary?n=e.name+"=":n="","\\"+r+"{"+n+e.value+"}"},"UnicodeProperty")};$A.exports={generate:Qt}});var WA=K((qte,HA)=>{"use strict";var h1={General_Category:"gc",Script:"sc",Script_Extensions:"scx"},cd=qp(h1),Dp={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"},Bi=qp(Dp),y1={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"},Np=qp(y1),m1={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"},Bp=qp(m1);function qp(t){var e={};for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];if(Array.isArray(n))for(var i=0;i<n.length;i++)e[n[i]]=r;else e[n]=r}return e}o(qp,"inverseMap");function gE(t){return h1.hasOwnProperty(t)||cd.hasOwnProperty(t)||Dp.hasOwnProperty(t)||Bi.hasOwnProperty(t)}o(gE,"isValidName");function vE(t,e){return wE(t)?VA(e):_E(t)?LA(e):!1}o(vE,"isValidValue");function bE(t){return cd.hasOwnProperty(t)||Bi.hasOwnProperty(t)}o(bE,"isAlias");function wE(t){return t==="General_Category"||t=="gc"}o(wE,"isGeneralCategoryName");function _E(t){return t==="Script"||t==="Script_Extensions"||t==="sc"||t==="scx"}o(_E,"isScriptCategoryName");function VA(t){return y1.hasOwnProperty(t)||Np.hasOwnProperty(t)}o(VA,"isGeneralCategoryValue");function LA(t){return m1.hasOwnProperty(t)||Bp.hasOwnProperty(t)}o(LA,"isScriptCategoryValue");function xE(t){return Dp.hasOwnProperty(t)||Bi.hasOwnProperty(t)}o(xE,"isBinaryPropertyName");function AE(t){return cd.hasOwnProperty(t)?cd[t]:Bi.hasOwnProperty(t)?Bi[t]:null}o(AE,"getCanonicalName");function SE(t){return Np.hasOwnProperty(t)?Np[t]:Bp.hasOwnProperty(t)?Bp[t]:Bi.hasOwnProperty(t)?Bi[t]:null}o(SE,"getCanonicalValue");HA.exports={isAlias:bE,isValidName:gE,isValidValue:vE,isGeneralCategoryValue:VA,isScriptCategoryValue:LA,isBinaryPropertyName:xE,getCanonicalName:AE,getCanonicalValue:SE,NON_BINARY_PROP_NAMES_TO_ALIASES:h1,NON_BINARY_ALIASES_TO_PROP_NAMES:cd,BINARY_PROP_NAMES_TO_ALIASES:Dp,BINARY_ALIASES_TO_PROP_NAMES:Bi,GENERAL_CATEGORY_VALUE_TO_ALIASES:y1,GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES:Np,SCRIPT_VALUE_TO_ALIASES:m1,SCRIPT_VALUE_ALIASES_TO_VALUE:Bp}});var n3=K((Ute,r3)=>{"use strict";var kE=(function(){function t(e,r){var n=[],i=!0,s=!1,u=void 0;try{for(var a=e[Symbol.iterator](),c;!(i=(c=a.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(d){s=!0,u=d}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return n}return o(t,"sliceIterator"),function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();function XA(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(XA,"_toConsumableArray");var on=void 0,ZA=void 0,Je={},T=void 0,k=void 0;function M(t,e){return Je.options.captureLocations?!t||!e?t||e:{startOffset:t.startOffset,endOffset:e.endOffset,startLine:t.startLine,endLine:e.endLine,startColumn:t.startColumn,endColumn:e.endColumn}:null}o(M,"yyloc");var QA="$",CE=[[-1,1,function(t,e){k=M(e,e),T=t}],[0,4,function(t,e,r,n,i,s,u,a){k=M(i,a),T=je({type:"RegExp",body:e,flags:OE(n)},Mp(i,a||u))}],[1,1,function(t,e){k=M(e,e),T=t}],[1,0,function(){k=null,T=""}],[2,1,function(t,e){k=M(e,e),T=t}],[2,2,function(t,e,r,n){k=M(r,n),T=t+e}],[3,1,function(t,e){k=M(e,e),T=t}],[4,1,function(t,e){k=M(e,e),T=t}],[4,3,function(t,e,r,n,i,s){k=M(n,s);var u=null;i&&(u=Mp(n||i,s||i)),T=je({type:"Disjunction",left:t,right:r},u)}],[5,1,function(t,e){if(k=M(e,e),t.length===0){T=null;return}t.length===1?T=je(t[0],k):T=je({type:"Alternative",expressions:t},k)}],[6,0,function(){k=null,T=[]}],[6,2,function(t,e,r,n){k=M(r,n),T=t.concat(e)}],[7,1,function(t,e){k=M(e,e),T=je(Object.assign({type:"Assertion"},t),k)}],[7,2,function(t,e,r,n){k=M(r,n),T=t,e&&(T=je({type:"Repetition",expression:t,quantifier:e},k))}],[8,1,function(t,e){k=M(e,e),T={kind:"^"}}],[8,1,function(t,e){k=M(e,e),T={kind:"$"}}],[8,1,function(t,e){k=M(e,e),T={kind:"\\b"}}],[8,1,function(t,e){k=M(e,e),T={kind:"\\B"}}],[8,3,function(t,e,r,n,i,s){k=M(n,s),T={kind:"Lookahead",assertion:e}}],[8,3,function(t,e,r,n,i,s){k=M(n,s),T={kind:"Lookahead",negative:!0,assertion:e}}],[8,3,function(t,e,r,n,i,s){k=M(n,s),T={kind:"Lookbehind",assertion:e}}],[8,3,function(t,e,r,n,i,s){k=M(n,s),T={kind:"Lookbehind",negative:!0,assertion:e}}],[9,1,function(t,e){k=M(e,e),T=t}],[9,1,function(t,e){k=M(e,e),T=t}],[9,1,function(t,e){k=M(e,e),T=t}],[10,1,function(t,e){k=M(e,e),T=Tt(t,"simple",k)}],[10,1,function(t,e){k=M(e,e),T=Tt(t.slice(1),"simple",k),T.escaped=!0}],[10,1,function(t,e){k=M(e,e),T=Tt(t,"unicode",k),T.isSurrogatePair=!0}],[10,1,function(t,e){k=M(e,e),T=Tt(t,"unicode",k)}],[10,1,function(t,e){k=M(e,e),T=TE(t,k)}],[10,1,function(t,e){k=M(e,e),T=Tt(t,"control",k)}],[10,1,function(t,e){k=M(e,e),T=Tt(t,"hex",k)}],[10,1,function(t,e){k=M(e,e),T=Tt(t,"oct",k)}],[10,1,function(t,e){k=M(e,e),T=RE(t,k)}],[10,1,function(t,e){k=M(e,e),T=Tt(t,"meta",k)}],[10,1,function(t,e){k=M(e,e),T=Tt(t,"meta",k)}],[10,1,function(t,e){k=M(e,e),T=qE(t,e)}],[11,1,function(t,e){k=M(e,e),T=t}],[11,0],[12,1,function(t,e){k=M(e,e),T=t}],[12,2,function(t,e,r,n){k=M(r,n),t.greedy=!1,T=t}],[13,1,function(t,e){k=M(e,e),T=je({type:"Quantifier",kind:t,greedy:!0},k)}],[13,1,function(t,e){k=M(e,e),T=je({type:"Quantifier",kind:t,greedy:!0},k)}],[13,1,function(t,e){k=M(e,e),T=je({type:"Quantifier",kind:t,greedy:!0},k)}],[13,1,function(t,e){k=M(e,e);var r=v1(t);T=je({type:"Quantifier",kind:"Range",from:r[0],to:r[0],greedy:!0},k)}],[13,1,function(t,e){k=M(e,e),T=je({type:"Quantifier",kind:"Range",from:v1(t)[0],greedy:!0},k)}],[13,1,function(t,e){k=M(e,e);var r=v1(t);T=je({type:"Quantifier",kind:"Range",from:r[0],to:r[1],greedy:!0},k)}],[14,1,function(t,e){k=M(e,e),T=t}],[14,1,function(t,e){k=M(e,e),T=t}],[15,3,function(t,e,r,n,i,s){k=M(n,s);var u=String(t),a=e3(u);if(!Je.options.allowGroupNameDuplicates&&fd.hasOwnProperty(a))throw new SyntaxError('Duplicate of the named group "'+a+'".');fd[a]=t.groupNumber,T=je({type:"Group",capturing:!0,name:a,nameRaw:u,number:t.groupNumber,expression:e},k)}],[15,3,function(t,e,r,n,i,s){k=M(n,s),T=je({type:"Group",capturing:!0,number:t.groupNumber,expression:e},k)}],[16,3,function(t,e,r,n,i,s){k=M(n,s),T=je({type:"Group",capturing:!1,expression:e},k)}],[17,3,function(t,e,r,n,i,s){k=M(n,s),T=je({type:"CharacterClass",negative:!0,expressions:e},k)}],[17,3,function(t,e,r,n,i,s){k=M(n,s),T=je({type:"CharacterClass",expressions:e},k)}],[18,0,function(){k=null,T=[]}],[18,1,function(t,e){k=M(e,e),T=t}],[19,1,function(t,e){k=M(e,e),T=[t]}],[19,2,function(t,e,r,n){k=M(r,n),T=[t].concat(e)}],[19,4,function(t,e,r,n,i,s,u,a){k=M(i,a),KA(t,r),T=[je({type:"ClassRange",from:t,to:r},Mp(i,u))],n&&(T=T.concat(n))}],[20,1,function(t,e){k=M(e,e),T=t}],[20,2,function(t,e,r,n){k=M(r,n),T=[t].concat(e)}],[20,4,function(t,e,r,n,i,s,u,a){k=M(i,a),KA(t,r),T=[je({type:"ClassRange",from:t,to:r},Mp(i,u))],n&&(T=T.concat(n))}],[21,1,function(t,e){k=M(e,e),T=Tt(t,"simple",k)}],[21,1,function(t,e){k=M(e,e),T=t}],[22,1,function(t,e){k=M(e,e),T=t}],[22,1,function(t,e){k=M(e,e),T=Tt(t,"meta",k)}]],FA={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"},g1=[{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"}],Pt=[],Yt=void 0,EE=[[/^#[^\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 t=on.slice(3,-1);return JA(t,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 t=this.getCurrentState();if(t==="u_class"&&on==="\\-")return"ESC_CHAR";if(t==="u"||t==="xu"||t==="u_class")throw new SyntaxError("invalid Unicode escape "+on);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 on=on.slice(3,-1),JA(on,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 t=this.getCurrentState();return this.pushState(t==="u"||t==="xu"?"u_class":"class"),"NEG_CLASS"}],[/^\[/,function(){var t=this.getCurrentState();return this.pushState(t==="u"||t==="xu"?"u_class":"class"),"L_BRACKET"}]],PE={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]},zA={type:QA,value:""};Yt={initString:o(function(e){return this._string=e,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"),getStates:o(function(){return this._states},"getStates"),getCurrentState:o(function(){return this._states[this._states.length-1]},"getCurrentState"),pushState:o(function(e){this._states.push(e)},"pushState"),begin:o(function(e){this.pushState(e)},"begin"),popState:o(function(){return this._states.length>1?this._states.pop():this._states[0]},"popState"),getNextToken:o(function(){if(this._tokensQueue.length>0)return this.onToken(this._toToken(this._tokensQueue.shift()));if(!this.hasMoreTokens())return this.onToken(zA);for(var e=this._string.slice(this._cursor),r=PE[this.getCurrentState()],n=0;n<r.length;n++){var i=r[n],s=EE[i],u=this._match(e,s[0]);if(e===""&&u===""&&this._cursor++,u!==null){on=u,ZA=on.length;var a=s[1].call(this);if(!a)return this.getNextToken();if(Array.isArray(a)){var c=a.slice(1);if(a=a[0],c.length>0){var d;(d=this._tokensQueue).unshift.apply(d,XA(c))}}return this.onToken(this._toToken(a,on))}}if(this.isEOF())return this._cursor++,zA;this.throwUnexpectedToken(e[0],this._currentLine,this._currentColumn)},"getNextToken"),throwUnexpectedToken:o(function(e,r,n){var i=this._string.split(`
|
|
2
2
|
`)[r-1],s="";if(i){var u=" ".repeat(n);s=`
|
|
3
3
|
|
|
4
4
|
`+i+`
|
|
5
5
|
`+u+`^
|
|
6
|
-
`}throw new SyntaxError(s+'Unexpected token: "'+e+'" '+("at "+r+":"+n+"."))},"throwUnexpectedToken"),getCursor:o(function(){return this._cursor},"getCursor"),getCurrentLine:o(function(){return this._currentLine},"getCurrentLine"),getCurrentColumn:o(function(){return this._currentColumn},"getCurrentColumn"),_captureLocation:o(function(e){var r=/\n/g;this._tokenStartOffset=this._cursor,this._tokenStartLine=this._currentLine,this._tokenStartColumn=this._tokenStartOffset-this._currentLineBeginOffset;for(var n=void 0;(n=r.exec(e))!==null;)this._currentLine++,this._currentLineBeginOffset=this._tokenStartOffset+n.index+1;this._tokenEndOffset=this._cursor+e.length,this._tokenEndLine=this._currentLine,this._tokenEndColumn=this._currentColumn=this._tokenEndOffset-this._currentLineBeginOffset},"_captureLocation"),_toToken:o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return{type:e,value:r,startOffset:this._tokenStartOffset,endOffset:this._tokenEndOffset,startLine:this._tokenStartLine,endLine:this._tokenEndLine,startColumn:this._tokenStartColumn,endColumn:this._tokenEndColumn}},"_toToken"),isEOF:o(function(){return this._cursor===this._string.length},"isEOF"),hasMoreTokens:o(function(){return this._cursor<=this._string.length},"hasMoreTokens"),_match:o(function(e,r){var n=e.match(r);return n?(this._captureLocation(n[0]),this._cursor+=n[0].length,n[0]):null},"_match"),onToken:o(function(e){return e},"onToken")};
|
|
7
|
-
`,i=n.codePointAt(0);break;case"\\r":n="\r",i=n.codePointAt(0);break;case"\\v":n="\v",i=n.codePointAt(0);break;case"\\f":n="\f",i=n.codePointAt(0);break;case"\\b":n="\b",i=n.codePointAt(0);case"\\0":n="\0",i=0;case".":n=".",i=NaN;break;default:i=NaN}break}case"simple":{n=t,i=n.codePointAt(0);break}}return Pe({type:"Char",value:t,kind:e,symbol:n,codePoint:i},r)}o(_t,"Char");var t8="gimsuxy";function r8(t){var e=new Set,r=!0,n=!1,i=void 0;try{for(var s=t[Symbol.iterator](),u;!(r=(u=s.next()).done);r=!0){var a=u.value;if(e.has(a)||!t8.includes(a))throw new SyntaxError("Invalid flags: "+t);e.add(a)}}catch(c){n=!0,i=c}finally{try{!r&&s.return&&s.return()}finally{if(n)throw i}}return t.split("").sort().join("")}o(r8,"checkFlags");function n8(t,e){var r=Number(t.slice(1));return r>0&&r<=Vb?Pe({type:"Backreference",kind:"number",number:r,reference:r},e):_t(t,"decimal",e)}o(n8,"GroupRefOrDecChar");var i8=/^\\u[0-9a-fA-F]{4}/,o8=/^\\u\{[0-9a-fA-F]{1,}\}/,s8=/\\u\{[0-9a-fA-F]{1,}\}/;function fA(t,e){var r=s8.test(t),n=e==="u"||e==="xu"||e==="u_class";if(r&&!n)throw new SyntaxError('invalid group Unicode name "'+t+'", use `u` flag.');return t}o(fA,"validateUnicodeGroupName");var u8=/\\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 mA(t){return t.replace(new RegExp(u8,"g"),function(e,r,n,i,s,u,a){return r?String.fromCodePoint(parseInt(r,16),parseInt(n,16)):i?String.fromCodePoint(parseInt(i,16)):s?String.fromCodePoint(parseInt(s,16)):u?String.fromCodePoint(parseInt(u,16)):a?String.fromCodePoint(parseInt(a,16)):e})}o(mA,"decodeUnicodeGroupName");function a8(t,e){var r=t.slice(3,-1),n=mA(r);if(Kf.hasOwnProperty(n))return Pe({type:"Backreference",kind:"name",number:Kf[n],reference:n,referenceRaw:r},e);var i=null,s=null,u=null,a=null;e&&(i=e.startOffset,s=e.startLine,u=e.endLine,a=e.startColumn);var c=/^[\w$<>]/,d=void 0,p=[_t(t.slice(1,2),"simple",i?{startLine:s,endLine:u,startColumn:a,startOffset:i,endOffset:i+=2,endColumn:a+=2}:null)];for(p[0].escaped=!0,t=t.slice(2);t.length>0;){var y=null;(y=t.match(i8))||(y=t.match(o8))?(i&&(d={startLine:s,endLine:u,startColumn:a,startOffset:i,endOffset:i+=y[0].length,endColumn:a+=y[0].length}),p.push(_t(y[0],"unicode",d)),t=t.slice(y[0].length)):(y=t.match(c))&&(i&&(d={startLine:s,endLine:u,startColumn:a,startOffset:i,endOffset:++i,endColumn:++a}),p.push(_t(y[0],"simple",d)),t=t.slice(1))}return p}o(a8,"NamedGroupRefOrChars");function Pe(t,e){return Le.options.captureLocations&&(t.loc={source:yA.slice(e.startOffset,e.endOffset),start:{line:e.startLine,column:e.startColumn,offset:e.startOffset},end:{line:e.endLine,column:e.endColumn,offset:e.endOffset}}),t}o(Pe,"Node");function gp(t,e){return Le.options.captureLocations?{startOffset:t.startOffset,endOffset:e.endOffset,startLine:t.startLine,endLine:e.endLine,startColumn:t.startColumn,endColumn:e.endColumn}:null}o(gp,"loc");function dA(t){t.type===hA&&gA(),Ht.throwUnexpectedToken(t.value,t.startLine,t.startColumn)}o(dA,"unexpectedToken");function gA(){c8("Unexpected end of input.")}o(gA,"unexpectedEndOfInput");function c8(t){throw new SyntaxError(t)}o(c8,"parseError");vA.exports=go});var zf=K((aQ,wA)=>{"use strict";var Jf=bA(),f8=Jf.parse.bind(Jf);Jf.parse=function(t,e){return f8(""+t,e)};Jf.setOptions({captureLocations:!1});wA.exports=Jf});var bp=K((cQ,xA)=>{"use strict";var d8=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function l8(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(l8,"_classCallCheck");var vp="expressions",_A="expression",Lb=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;l8(this,t),this.node=e,this.parentPath=r,this.parent=r?r.node:null,this.property=n,this.index=i}return o(t,"NodePath"),d8(t,[{key:"_enforceProp",value:o(function(r){if(!this.node.hasOwnProperty(r))throw new Error("Node of type "+this.node.type+` doesn't have "`+r+'" collection.')},"_enforceProp")},{key:"setChild",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=void 0;return n!=null?(i||(i=vp),this._enforceProp(i),this.node[i][n]=r,s=t.getForNode(r,this,i,n)):(i||(i=_A),this._enforceProp(i),this.node[i]=r,s=t.getForNode(r,this,i,null)),s},"setChild")},{key:"appendChild",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;n||(n=vp),this._enforceProp(n);var i=this.node[n].length;return this.setChild(r,i,n)},"appendChild")},{key:"insertChildAt",value:o(function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vp;this._enforceProp(i),this.node[i].splice(n,0,r),n<=t.getTraversingIndex()&&t.updateTraversingIndex(1),this._rebuildIndex(this.node,i)},"insertChildAt")},{key:"remove",value:o(function(){if(!this.isRemoved()&&(t.registry.delete(this.node),this.node=null,!!this.parent)){if(this.index!==null){this.parent[this.property].splice(this.index,1),this.index<=t.getTraversingIndex()&&t.updateTraversingIndex(-1),this._rebuildIndex(this.parent,this.property),this.index=null,this.property=null;return}delete this.parent[this.property],this.property=null}},"remove")},{key:"_rebuildIndex",value:o(function(r,n){for(var i=t.getForNode(r),s=0;s<r[n].length;s++){var u=t.getForNode(r[n][s],i,n,s);u.index=s}},"_rebuildIndex")},{key:"isRemoved",value:o(function(){return this.node===null},"isRemoved")},{key:"replace",value:o(function(r){return t.registry.delete(this.node),this.node=r,this.parent?(this.index!==null?this.parent[this.property][this.index]=r:this.parent[this.property]=r,t.getForNode(r,this.parentPath,this.property,this.index)):null},"replace")},{key:"update",value:o(function(r){Object.assign(this.node,r)},"update")},{key:"getParent",value:o(function(){return this.parentPath},"getParent")},{key:"getChild",value:o(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.node.expressions?t.getForNode(this.node.expressions[r],this,vp,r):this.node.expression&&r==0?t.getForNode(this.node.expression,this,_A):null},"getChild")},{key:"hasEqualSource",value:o(function(r){return JSON.stringify(this.node,Hb)===JSON.stringify(r.node,Hb)},"hasEqualSource")},{key:"jsonEncode",value:o(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=r.format,i=r.useLoc;return JSON.stringify(this.node,i?null:Hb,n)},"jsonEncode")},{key:"getPreviousSibling",value:o(function(){return!this.parent||this.index==null?null:t.getForNode(this.parent[this.property][this.index-1],t.getForNode(this.parent),this.property,this.index-1)},"getPreviousSibling")},{key:"getNextSibling",value:o(function(){return!this.parent||this.index==null?null:t.getForNode(this.parent[this.property][this.index+1],t.getForNode(this.parent),this.property,this.index+1)},"getNextSibling")}],[{key:"getForNode",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1;if(!r)return null;t.registry.has(r)||t.registry.set(r,new t(r,n,i,s==-1?null:s));var u=t.registry.get(r);return n!==null&&(u.parentPath=n,u.parent=u.parentPath.node),i!==null&&(u.property=i),s>=0&&(u.index=s),u},"getForNode")},{key:"initRegistry",value:o(function(){t.registry||(t.registry=new Map),t.registry.clear()},"initRegistry")},{key:"updateTraversingIndex",value:o(function(r){return t.traversingIndexStack[t.traversingIndexStack.length-1]+=r},"updateTraversingIndex")},{key:"getTraversingIndex",value:o(function(){return t.traversingIndexStack[t.traversingIndexStack.length-1]},"getTraversingIndex")}]),t})();Lb.initRegistry();Lb.traversingIndexStack=[];function Hb(t,e){if(t!=="loc")return e}o(Hb,"jsonSkipLoc");xA.exports=Lb});var Wb=K((dQ,AA)=>{"use strict";var ka=bp();function p8(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.pre,n=e.post,i=e.skipProperty;function s(u,a,c,d){if(!(!u||typeof u.type!="string")){var p=void 0;if(r&&(p=r(u,a,c,d)),p!==!1){a&&a[c]&&(isNaN(d)?u=a[c]:u=a[c][d]);for(var y in u)if(u.hasOwnProperty(y)){if(i?i(y,u):y[0]==="$")continue;var v=u[y];if(Array.isArray(v)){var x=0;for(ka.traversingIndexStack.push(x);x<v.length;)s(v[x],u,y,x),x=ka.updateTraversingIndex(1);ka.traversingIndexStack.pop()}else s(v,u,y)}}n&&n(u,a,c,d)}}o(s,"visit"),s(t,null)}o(p8,"astTraverse");AA.exports={traverse:o(function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{asNodes:!1};Array.isArray(r)||(r=[r]),r=r.filter(function(s){return typeof s.shouldRun!="function"?!0:s.shouldRun(e)}),ka.initRegistry(),r.forEach(function(s){typeof s.init=="function"&&s.init(e)});function i(s,u,a,c){var d=ka.getForNode(u),p=ka.getForNode(s,d,a,c);return p}o(i,"getPathFor"),p8(e,{pre:o(function(u,a,c,d){var p=void 0;n.asNodes||(p=i(u,a,c,d));var y=!0,v=!1,x=void 0;try{for(var A=r[Symbol.iterator](),B;!(y=(B=A.next()).done);y=!0){var I=B.value;if(typeof I["*"]=="function")if(p){if(!p.isRemoved()){var J=I["*"](p);if(J===!1)return!1}}else I["*"](u,a,c,d);var de=void 0;if(typeof I[u.type]=="function"?de=I[u.type]:typeof I[u.type]=="object"&&typeof I[u.type].pre=="function"&&(de=I[u.type].pre),de)if(p){if(!p.isRemoved()){var fe=de.call(I,p);if(fe===!1)return!1}}else de.call(I,u,a,c,d)}}catch(ve){v=!0,x=ve}finally{try{!y&&A.return&&A.return()}finally{if(v)throw x}}},"pre"),post:o(function(u,a,c,d){if(u){var p=void 0;n.asNodes||(p=i(u,a,c,d));var y=!0,v=!1,x=void 0;try{for(var A=r[Symbol.iterator](),B;!(y=(B=A.next()).done);y=!0){var I=B.value,J=void 0;if(typeof I[u.type]=="object"&&typeof I[u.type].post=="function"&&(J=I[u.type].post),J)if(p){if(!p.isRemoved()){var de=J.call(I,p);if(de===!1)return!1}}else J.call(I,u,a,c,d)}}catch(fe){v=!0,x=fe}finally{try{!y&&A.return&&A.return()}finally{if(v)throw x}}}},"post"),skipProperty:o(function(u){return u==="loc"},"skipProperty")})},"traverse")}});var wp=K((pQ,CA)=>{"use strict";var h8=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function y8(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(y8,"_classCallCheck");var SA=Bb(),m8=zf(),g8=Wb(),kA=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;y8(this,t),this._ast=e,this._source=null,this._string=null,this._regexp=null,this._extra=r}return o(t,"TransformResult"),h8(t,[{key:"getAST",value:o(function(){return this._ast},"getAST")},{key:"setExtra",value:o(function(r){this._extra=r},"setExtra")},{key:"getExtra",value:o(function(){return this._extra},"getExtra")},{key:"toRegExp",value:o(function(){return this._regexp||(this._regexp=new RegExp(this.getSource(),this._ast.flags)),this._regexp},"toRegExp")},{key:"getSource",value:o(function(){return this._source||(this._source=SA.generate(this._ast.body)),this._source},"getSource")},{key:"getFlags",value:o(function(){return this._ast.flags},"getFlags")},{key:"toString",value:o(function(){return this._string||(this._string=SA.generate(this._ast)),this._string},"toString")}]),t})();CA.exports={TransformResult:kA,transform:o(function(e,r){var n=e;return e instanceof RegExp&&(e=""+e),typeof e=="string"&&(n=m8.parse(e,{captureLocations:!0})),g8.traverse(n,r),new kA(n)},"transform")}});var PA=K((yQ,EA)=>{"use strict";var _p=tA(),v8=wp();EA.exports={transform:o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=r.length>0?r:Object.keys(_p),i=void 0,s={};return n.forEach(function(u){if(!_p.hasOwnProperty(u))throw new Error("Unknown compat-transform: "+u+". Available transforms are: "+Object.keys(_p).join(", "));var a=_p[u];i=v8.transform(e,a),e=i.getAST(),typeof a.getExtra=="function"&&(s[u]=a.getExtra())}),i.setExtra(s),i},"transform")}});var IA=K((gQ,TA)=>{"use strict";TA.exports=o(function t(e){if(e===null||typeof e!="object")return e;var r=void 0;Array.isArray(e)?r=[]:r={};for(var n in e)r[n]=t(e[n]);return r},"clone")});var RA=K((bQ,OA)=>{"use strict";OA.exports={shouldRun:o(function(e){return e.flags.includes("u")},"shouldRun"),Char:o(function(e){var r=e.node;r.kind!=="unicode"||!r.isSurrogatePair||isNaN(r.codePoint)||(r.value="\\u{"+r.codePoint.toString(16)+"}",delete r.isSurrogatePair)},"Char")}});var $A=K((_Q,UA)=>{"use strict";var jA="A".codePointAt(0),NA="Z".codePointAt(0),BA="a".codePointAt(0),DA="z".codePointAt(0),qA="0".codePointAt(0),MA="9".codePointAt(0);UA.exports={Char:o(function(e){var r=e.node,n=e.parent;if(!(isNaN(r.codePoint)||r.kind==="simple")&&!(n.type==="ClassRange"&&!b8(n))&&w8(r.codePoint)){var i=String.fromCodePoint(r.codePoint),s={type:"Char",kind:"simple",value:i,symbol:i,codePoint:r.codePoint};_8(i,n.type)&&(s.escaped=!0),e.replace(s)}},"Char")};function b8(t){var e=t.from,r=t.to;return e.codePoint>=qA&&e.codePoint<=MA&&r.codePoint>=qA&&r.codePoint<=MA||e.codePoint>=jA&&e.codePoint<=NA&&r.codePoint>=jA&&r.codePoint<=NA||e.codePoint>=BA&&e.codePoint<=DA&&r.codePoint>=BA&&r.codePoint<=DA}o(b8,"isSimpleRange");function w8(t){return t>=32&&t<=126}o(w8,"isPrintableASCIIChar");function _8(t,e){return e==="ClassRange"||e==="CharacterClass"?/[\]\\^-]/.test(t):/[*[()+?^$./\\|{}]/.test(t)}o(_8,"needsEscape")});var WA=K((AQ,LA)=>{"use strict";var VA="A".codePointAt(0),HA="Z".codePointAt(0);LA.exports={_AZClassRanges:null,_hasUFlag:!1,init:o(function(e){this._AZClassRanges=new Set,this._hasUFlag=e.flags.includes("u")},"init"),shouldRun:o(function(e){return e.flags.includes("i")},"shouldRun"),Char:o(function(e){var r=e.node,n=e.parent;if(!isNaN(r.codePoint)&&!(!this._hasUFlag&&r.codePoint>=4096)){if(n.type==="ClassRange"){if(!this._AZClassRanges.has(n)&&!x8(n))return;this._AZClassRanges.add(n)}var i=r.symbol.toLowerCase();i!==r.symbol&&(r.value=A8(i,r),r.symbol=i,r.codePoint=i.codePointAt(0))}},"Char")};function x8(t){var e=t.from,r=t.to;return e.codePoint>=VA&&e.codePoint<=HA&&r.codePoint>=VA&&r.codePoint<=HA}o(x8,"isAZClassRange");function A8(t,e){var r=t.codePointAt(0);if(e.kind==="decimal")return"\\"+r;if(e.kind==="oct")return"\\0"+r.toString(8);if(e.kind==="hex")return"\\x"+r.toString(16);if(e.kind==="unicode")if(e.isSurrogatePair){var n=S8(r),i=n.lead,s=n.trail;return"\\u"+"0".repeat(4-i.length)+i+"\\u"+"0".repeat(4-s.length)+s}else{if(e.value.includes("{"))return"\\u{"+r.toString(16)+"}";var u=r.toString(16);return"\\u"+"0".repeat(4-u.length)+u}return t}o(A8,"displaySymbolAsValue");function S8(t){var e=Math.floor((t-65536)/1024)+55296,r=(t-65536)%1024+56320;return{lead:e.toString(16),trail:r.toString(16)}}o(S8,"getSurrogatePairFromCodePoint")});var KA=K((kQ,FA)=>{"use strict";FA.exports={CharacterClass:o(function(e){for(var r=e.node,n={},i=0;i<r.expressions.length;i++){var s=e.getChild(i),u=s.jsonEncode();n.hasOwnProperty(u)&&(s.remove(),i--),n[u]=!0}},"CharacterClass")}});var xp=K((EQ,zA)=>{"use strict";function k8(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(k8,"_toConsumableArray");function JA(t){if(t.type!=="Disjunction")throw new TypeError('Expected "Disjunction" node, got "'+t.type+'"');var e=[];return t.left&&t.left.type==="Disjunction"?e.push.apply(e,k8(JA(t.left)).concat([t.right])):e.push(t.left,t.right),e}o(JA,"disjunctionToList");function C8(t){return t.reduce(function(e,r){return{type:"Disjunction",left:e,right:r}})}o(C8,"listToDisjunction");function E8(t){t.kind==="*"?t.kind="+":t.kind==="+"?(t.kind="Range",t.from=2,delete t.to):t.kind==="?"?(t.kind="Range",t.from=1,t.to=2):t.kind==="Range"&&(t.from+=1,t.to&&(t.to+=1))}o(E8,"increaseQuantifierByOne");zA.exports={disjunctionToList:JA,listToDisjunction:C8,increaseQuantifierByOne:E8}});var ZA=K((TQ,XA)=>{"use strict";var P8=xp(),T8=P8.increaseQuantifierByOne;XA.exports={Repetition:o(function(e){var r=e.node,n=e.parent;if(!(n.type!=="Alternative"||!e.index)){var i=e.getPreviousSibling();if(i)if(i.node.type==="Repetition"){if(!i.getChild().hasEqualSource(e.getChild()))return;var s=GA(i.node.quantifier),u=s.from,a=s.to,c=GA(r.quantifier),d=c.from,p=c.to;if(i.node.quantifier.greedy!==r.quantifier.greedy&&!Ap(i.node.quantifier)&&!Ap(r.quantifier))return;r.quantifier.kind="Range",r.quantifier.from=u+d,a&&p?r.quantifier.to=a+p:delete r.quantifier.to,(Ap(i.node.quantifier)||Ap(r.quantifier))&&(r.quantifier.greedy=!0),i.remove()}else{if(!i.hasEqualSource(e.getChild()))return;T8(r.quantifier),i.remove()}}},"Repetition")};function Ap(t){return t.greedy&&(t.kind==="+"||t.kind==="*"||t.kind==="Range"&&!t.to)}o(Ap,"isGreedyOpenRange");function GA(t){var e=void 0,r=void 0;return t.kind==="*"?e=0:t.kind==="+"?e=1:t.kind==="?"?(e=0,r=1):(e=t.from,t.to&&(r=t.to)),{from:e,to:r}}o(GA,"extractFromTo")});var YA=K((OQ,QA)=>{"use strict";QA.exports={Quantifier:o(function(e){var r=e.node;r.kind==="Range"&&(I8(e),O8(e),R8(e))},"Quantifier")};function I8(t){var e=t.node;e.from!==0||e.to||(e.kind="*",delete e.from)}o(I8,"rewriteOpenZero");function O8(t){var e=t.node;e.from!==1||e.to||(e.kind="+",delete e.from)}o(O8,"rewriteOpenOne");function R8(t){var e=t.node;e.from!==1||e.to!==1||t.parentPath.replace(t.parentPath.node.expression)}o(R8,"rewriteExactOne")});var t3=K((jQ,e3)=>{"use strict";e3.exports={ClassRange:o(function(e){var r=e.node;r.from.codePoint===r.to.codePoint?e.replace(r.from):r.from.codePoint===r.to.codePoint-1&&(e.getParent().insertChildAt(r.to,e.index+1),e.replace(r.from))},"ClassRange")}});var o3=K((BQ,i3)=>{"use strict";function r3(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(r3,"_toConsumableArray");i3.exports={_hasIFlag:!1,_hasUFlag:!1,init:o(function(e){this._hasIFlag=e.flags.includes("i"),this._hasUFlag=e.flags.includes("u")},"init"),CharacterClass:o(function(e){j8(e),N8(e,this._hasIFlag,this._hasUFlag),B8(e)},"CharacterClass")};function j8(t){var e=t.node;e.expressions.forEach(function(r,n){D8(r)&&t.getChild(n).replace({type:"Char",value:"\\d",kind:"meta"})})}o(j8,"rewriteNumberRanges");function N8(t,e,r){var n=t.node,i=null,s=null,u=null,a=null,c=null,d=null;n.expressions.forEach(function(p,y){Kb(p,"\\d")?i=t.getChild(y):q8(p)?s=t.getChild(y):M8(p)?u=t.getChild(y):U8(p)?a=t.getChild(y):e&&r&&Gf(p,383)?c=t.getChild(y):e&&r&&Gf(p,8490)&&(d=t.getChild(y))}),i&&(s&&u||e&&(s||u))&&a&&(!r||!e||c&&d)&&(i.replace({type:"Char",value:"\\w",kind:"meta"}),s&&s.remove(),u&&u.remove(),a.remove(),c&&c.remove(),d&&d.remove())}o(N8,"rewriteWordRanges");var Fb=[function(t){return n3(t," ")}].concat(r3(["\\f","\\n","\\r","\\t","\\v"].map(function(t){return function(e){return Kb(e,t)}})),r3([160,5760,8232,8233,8239,8287,12288,65279].map(function(t){return function(e){return Gf(e,t)}})),[function(t){return t.type==="ClassRange"&&Gf(t.from,8192)&&Gf(t.to,8202)}]);function B8(t){var e=t.node;if(!(e.expressions.length<Fb.length||!Fb.every(function(n){return e.expressions.some(function(i){return n(i)})}))){var r=e.expressions.find(function(n){return Kb(n,"\\n")});r.value="\\s",r.symbol=void 0,r.codePoint=NaN,e.expressions.map(function(n,i){return Fb.some(function(s){return s(n)})?t.getChild(i):void 0}).filter(Boolean).forEach(function(n){return n.remove()})}}o(B8,"rewriteWhitespaceRanges");function D8(t){return t.type==="ClassRange"&&t.from.value==="0"&&t.to.value==="9"}o(D8,"isFullNumberRange");function n3(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"simple";return t.type==="Char"&&t.value===e&&t.kind===r}o(n3,"isChar");function Kb(t,e){return n3(t,e,"meta")}o(Kb,"isMetaChar");function q8(t){return t.type==="ClassRange"&&t.from.value==="a"&&t.to.value==="z"}o(q8,"isLowerCaseRange");function M8(t){return t.type==="ClassRange"&&t.from.value==="A"&&t.to.value==="Z"}o(M8,"isUpperCaseRange");function U8(t){return t.type==="Char"&&t.value==="_"&&t.kind==="simple"}o(U8,"isUnderscore");function Gf(t,e){return t.type==="Char"&&t.kind==="unicode"&&t.codePoint===e}o(Gf,"isCodePoint")});var u3=K((qQ,s3)=>{"use strict";s3.exports={CharacterClass:o(function(e){var r=e.node;if(!(r.expressions.length!==1||!L8(e)||!$8(r.expressions[0]))){var n=r.expressions[0],i=n.value,s=n.kind,u=n.escaped;if(r.negative){if(!V8(i))return;i=H8(i)}e.replace({type:"Char",value:i,kind:s,escaped:u||W8(i)})}},"CharacterClass")};function $8(t){return t.type==="Char"&&t.value!=="\\b"}o($8,"isAppropriateChar");function V8(t){return/^\\[dwsDWS]$/.test(t)}o(V8,"isMeta");function H8(t){return/[dws]/.test(t)?t.toUpperCase():t.toLowerCase()}o(H8,"getInverseMeta");function L8(t){var e=t.parent,r=t.index;if(e.type!=="Alternative")return!0;var n=e.expressions[r-1];return n==null?!0:!(n.type==="Backreference"&&n.kind==="number"||n.type==="Char"&&n.kind==="decimal")}o(L8,"hasAppropriateSiblings");function W8(t){return/[*[()+?$./{}|]/.test(t)}o(W8,"shouldEscape")});var c3=K((UQ,a3)=>{"use strict";a3.exports={_hasXFlag:!1,init:o(function(e){this._hasXFlag=e.flags.includes("x")},"init"),Char:o(function(e){var r=e.node;r.escaped&&F8(e,this._hasXFlag)&&delete r.escaped},"Char")};function F8(t,e){var r=t.node.value,n=t.index,i=t.parent;return i.type!=="CharacterClass"&&i.type!=="ClassRange"?!J8(r,n,i,e):!K8(r,n,i)}o(F8,"shouldUnescape");function K8(t,e,r){return t==="^"?e===0&&!r.negative:t==="-"?!0:/[\]\\]/.test(t)}o(K8,"preservesInCharClass");function J8(t,e,r,n){return t==="{"?z8(e,r):t==="}"?G8(e,r):n&&/[ #]/.test(t)?!0:/[*[()+?^$./\\|]/.test(t)}o(J8,"preservesEscape");function Sp(t,e,r){for(var n=t,i=(r?n>=0:n<e.expressions.length)&&e.expressions[n];i&&i.type==="Char"&&i.kind==="simple"&&!i.escaped&&/\d/.test(i.value);)r?n--:n++,i=(r?n>=0:n<e.expressions.length)&&e.expressions[n];return Math.abs(t-n)}o(Sp,"consumeNumbers");function Ca(t,e){return t&&t.type==="Char"&&t.kind==="simple"&&!t.escaped&&t.value===e}o(Ca,"isSimpleChar");function z8(t,e){if(t==null)return!1;var r=Sp(t+1,e),n=t+r+1,i=n<e.expressions.length&&e.expressions[n];if(r){if(Ca(i,"}"))return!0;if(Ca(i,","))return r=Sp(n+1,e),n=n+r+1,i=n<e.expressions.length&&e.expressions[n],Ca(i,"}")}return!1}o(z8,"preservesOpeningCurlyBraceEscape");function G8(t,e){if(t==null)return!1;var r=Sp(t-1,e,!0),n=t-r-1,i=n>=0&&e.expressions[n];return r&&Ca(i,"{")?!0:Ca(i,",")?(r=Sp(n-1,e,!0),n=n-r-1,i=n<e.expressions.length&&e.expressions[n],r&&Ca(i,"{")):!1}o(G8,"preservesClosingCurlyBraceEscape")});var p3=K((VQ,l3)=>{"use strict";l3.exports={_hasIUFlags:!1,init:o(function(e){this._hasIUFlags=e.flags.includes("i")&&e.flags.includes("u")},"init"),CharacterClass:o(function(e){var r=e.node,n=r.expressions,i=[];n.forEach(function(c){wn(c)&&i.push(c.value)}),n.sort(X8);for(var s=0;s<n.length;s++){var u=n[s];if(Z8(u,i,this._hasIUFlags)||Q8(u,n[s-1])||Y8(u,n[s+1]))n.splice(s,1),s--;else{var a=eE(u,s,n);n.splice(s-a+1,a),s-=a}}},"CharacterClass")};function X8(t,e){var r=kp(t),n=kp(e);if(r===n){if(t.type==="ClassRange"&&e.type!=="ClassRange")return-1;if(e.type==="ClassRange"&&t.type!=="ClassRange")return 1;if(t.type==="ClassRange"&&e.type==="ClassRange")return kp(t.to)-kp(e.to);if(wn(t)&&wn(e)||f3(t)&&f3(e))return t.value<e.value?-1:1}return r-n}o(X8,"sortCharClass");function kp(t){return t.type==="Char"?t.value==="-"||t.kind==="control"?1/0:t.kind==="meta"&&isNaN(t.codePoint)?-1:t.codePoint:t.from.codePoint}o(kp,"getSortValue");function wn(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.type==="Char"&&t.kind==="meta"&&(e?t.value===e:/^\\[dws]$/i.test(t.value))}o(wn,"isMeta");function f3(t){return t.type==="Char"&&t.kind==="control"}o(f3,"isControl");function Z8(t,e,r){for(var n=0;n<e.length;n++)if(Jb(t,e[n],r))return!0;return!1}o(Z8,"fitsInMetas");function Jb(t,e,r){return t.type==="ClassRange"?Jb(t.from,e,r)&&Jb(t.to,e,r):e==="\\S"&&(wn(t,"\\w")||wn(t,"\\d"))||e==="\\D"&&(wn(t,"\\W")||wn(t,"\\s"))||e==="\\w"&&wn(t,"\\d")||e==="\\W"&&wn(t,"\\s")?!0:t.type!=="Char"||isNaN(t.codePoint)?!1:e==="\\s"?d3(t):e==="\\S"?!d3(t):e==="\\d"?zb(t):e==="\\D"?!zb(t):e==="\\w"?Gb(t,r):e==="\\W"?!Gb(t,r):!1}o(Jb,"fitsInMeta");function d3(t){return t.codePoint===9||t.codePoint===10||t.codePoint===11||t.codePoint===12||t.codePoint===13||t.codePoint===32||t.codePoint===160||t.codePoint===5760||t.codePoint>=8192&&t.codePoint<=8202||t.codePoint===8232||t.codePoint===8233||t.codePoint===8239||t.codePoint===8287||t.codePoint===12288||t.codePoint===65279}o(d3,"fitsInMetaS");function zb(t){return t.codePoint>=48&&t.codePoint<=57}o(zb,"fitsInMetaD");function Gb(t,e){return zb(t)||t.codePoint>=65&&t.codePoint<=90||t.codePoint>=97&&t.codePoint<=122||t.value==="_"||e&&(t.codePoint===383||t.codePoint===8490)}o(Gb,"fitsInMetaW");function Q8(t,e){if(e&&e.type==="ClassRange"){if(Xb(t,e))return!0;if(Cp(t)&&e.to.codePoint===t.codePoint-1)return e.to=t,!0;if(t.type==="ClassRange"&&t.from.codePoint<=e.to.codePoint+1&&t.to.codePoint>=e.from.codePoint-1)return t.from.codePoint<e.from.codePoint&&(e.from=t.from),t.to.codePoint>e.to.codePoint&&(e.to=t.to),!0}return!1}o(Q8,"combinesWithPrecedingClassRange");function Y8(t,e){return e&&e.type==="ClassRange"&&Cp(t)&&e.from.codePoint===t.codePoint+1?(e.from=t,!0):!1}o(Y8,"combinesWithFollowingClassRange");function Xb(t,e){return t.type==="Char"&&isNaN(t.codePoint)?!1:t.type==="ClassRange"?Xb(t.from,e)&&Xb(t.to,e):t.codePoint>=e.from.codePoint&&t.codePoint<=e.to.codePoint}o(Xb,"fitsInClassRange");function eE(t,e,r){if(!Cp(t))return 0;for(var n=0;e>0;){var i=r[e],s=r[e-1];if(Cp(s)&&s.codePoint===i.codePoint-1)n++,e--;else break}return n>1?(r[e]={type:"ClassRange",from:r[e],to:t},n):0}o(eE,"charCombinesWithPrecedingChars");function Cp(t){return t&&t.type==="Char"&&!isNaN(t.codePoint)&&(Gb(t,!1)||t.kind==="unicode"||t.kind==="hex"||t.kind==="oct"||t.kind==="decimal")}o(Cp,"isMetaWCharOrCode")});var m3=K((LQ,y3)=>{"use strict";var tE=bp(),h3=xp(),rE=h3.disjunctionToList,nE=h3.listToDisjunction;y3.exports={Disjunction:o(function(e){var r=e.node,n={},i=rE(r).filter(function(s){var u=s?tE.getForNode(s).jsonEncode():"null";return n.hasOwnProperty(u)?!1:(n[u]=s,!0)});e.replace(nE(i))},"Disjunction")}});var b3=K((FQ,v3)=>{"use strict";v3.exports={Disjunction:o(function(e){var r=e.node,n=e.parent;if(g3[n.type]){var i=new Map;if(!(!Ep(r,i)||!i.size)){var s={type:"CharacterClass",expressions:Array.from(i.keys()).sort().map(function(u){return i.get(u)})};g3[n.type](e.getParent(),s)}}},"Disjunction")};var g3={RegExp:o(function(e,r){var n=e.node;n.body=r},"RegExp"),Group:o(function(e,r){var n=e.node;n.capturing?n.expression=r:e.replace(r)},"Group")};function Ep(t,e){if(!t)return!1;var r=t.type;if(r==="Disjunction"){var n=t.left,i=t.right;return Ep(n,e)&&Ep(i,e)}else if(r==="Char"){if(t.kind==="meta"&&t.symbol===".")return!1;var s=t.value;return e.set(s,t),!0}else if(r==="CharacterClass"&&!t.negative)return t.expressions.every(function(u){return Ep(u,e)});return!1}o(Ep,"shouldProcess")});var _3=K((JQ,w3)=>{"use strict";w3.exports={Group:o(function(e){var r=e.node,n=e.parent,i=e.getChild();r.capturing||i||(n.type==="Repetition"?e.getParent().replace(r):n.type!=="RegExp"&&e.remove())},"Group")}});var A3=K((GQ,x3)=>{"use strict";function Zb(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(Zb,"_toConsumableArray");x3.exports={Group:o(function(e){var r=e.node,n=e.parent,i=e.getChild();if(!(r.capturing||!i)&&iE(e)&&!(i.node.type==="Disjunction"&&n.type!=="RegExp")&&!(n.type==="Repetition"&&i.node.type!=="Char"&&i.node.type!=="CharacterClass"))if(i.node.type==="Alternative"){var s=e.getParent();s.node.type==="Alternative"&&s.replace({type:"Alternative",expressions:[].concat(Zb(n.expressions.slice(0,e.index)),Zb(i.node.expressions),Zb(n.expressions.slice(e.index+1)))})}else e.replace(i.node)},"Group")};function iE(t){var e=t.parent,r=t.index;if(e.type!=="Alternative")return!0;var n=e.expressions[r-1];return n==null?!0:!(n.type==="Backreference"&&n.kind==="number"||n.type==="Char"&&n.kind==="decimal")}o(iE,"hasAppropriateSiblings")});var C3=K((ZQ,k3)=>{"use strict";function Pp(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(Pp,"_toConsumableArray");var Tp=bp(),oE=xp(),S3=oE.increaseQuantifierByOne;k3.exports={Alternative:o(function(e){for(var r=e.node,n=1;n<r.expressions.length;){var i=e.getChild(n);if(n=Math.max(1,sE(e,i,n)),n>=r.expressions.length||(i=e.getChild(n),n=Math.max(1,uE(e,i,n)),n>=r.expressions.length))break;i=e.getChild(n),n=Math.max(1,aE(e,i,n)),n++}},"Alternative")};function sE(t,e,r){for(var n=t.node,i=Math.ceil(r/2),s=0;s<i;){var u=r-2*s-1,a=void 0,c=void 0;if(s===0?(a=e,c=t.getChild(u)):(a=Tp.getForNode({type:"Alternative",expressions:[].concat(Pp(n.expressions.slice(r-s,r)),[e.node])}),c=Tp.getForNode({type:"Alternative",expressions:[].concat(Pp(n.expressions.slice(u,r-s)))})),a.hasEqualSource(c)){for(var d=0;d<2*s+1;d++)t.getChild(u).remove();return e.replace({type:"Repetition",expression:s===0&&a.node.type!=="Repetition"?a.node:{type:"Group",capturing:!1,expression:a.node},quantifier:{type:"Quantifier",kind:"Range",from:2,to:2,greedy:!0}}),u}s++}return r}o(sE,"combineRepeatingPatternLeft");function uE(t,e,r){for(var n=t.node,i=0;i<r;){var s=t.getChild(i);if(s.node.type==="Repetition"&&s.node.quantifier.greedy){var u=s.getChild(),a=void 0;if(u.node.type==="Group"&&!u.node.capturing&&(u=u.getChild()),i+1===r?(a=e,a.node.type==="Group"&&!a.node.capturing&&(a=a.getChild())):a=Tp.getForNode({type:"Alternative",expressions:[].concat(Pp(n.expressions.slice(i+1,r+1)))}),u.hasEqualSource(a)){for(var c=i;c<r;c++)t.getChild(i+1).remove();return S3(s.node.quantifier),i}}i++}return r}o(uE,"combineWithPreviousRepetition");function aE(t,e,r){var n=t.node;if(e.node.type==="Repetition"&&e.node.quantifier.greedy){var i=e.getChild(),s=void 0;i.node.type==="Group"&&!i.node.capturing&&(i=i.getChild());var u=void 0;if(i.node.type==="Alternative"?(u=i.node.expressions.length,s=Tp.getForNode({type:"Alternative",expressions:[].concat(Pp(n.expressions.slice(r-u,r)))})):(u=1,s=t.getChild(r-1),s.node.type==="Group"&&!s.node.capturing&&(s=s.getChild())),s.hasEqualSource(i)){for(var a=r-u;a<r;a++)t.getChild(r-u).remove();return S3(e.node.quantifier),r-u}}return r}o(aE,"combineRepetitionWithPrevious")});var P3=K((YQ,E3)=>{"use strict";E3.exports=new Map([["charSurrogatePairToSingleUnicode",RA()],["charCodeToSimpleChar",$A()],["charCaseInsensitiveLowerCaseTransform",WA()],["charClassRemoveDuplicates",KA()],["quantifiersMerge",ZA()],["quantifierRangeToSymbol",YA()],["charClassClassrangesToChars",t3()],["charClassToMeta",o3()],["charClassToSingleChar",u3()],["charEscapeUnescape",c3()],["charClassClassrangesMerge",p3()],["disjunctionRemoveDuplicates",m3()],["groupSingleCharsToCharClass",b3()],["removeEmptyGroup",_3()],["ungroup",A3()],["combineRepeatingPatterns",C3()]])});var R3=K((eY,O3)=>{"use strict";var T3=IA(),cE=zf(),I3=wp(),Ip=P3();O3.exports={optimize:o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.whitelist,i=n===void 0?[]:n,s=r.blacklist,u=s===void 0?[]:s,a=i.length>0?i:Array.from(Ip.keys()),c=a.filter(function(v){return!u.includes(v)}),d=e;e instanceof RegExp&&(e=""+e),typeof e=="string"&&(d=cE.parse(e));var p=new I3.TransformResult(d),y=void 0;do y=p.toString(),d=T3(p.getAST()),c.forEach(function(v){if(!Ip.has(v))throw new Error("Unknown optimization-transform: "+v+". Available transforms are: "+Array.from(Ip.keys()).join(", "));var x=Ip.get(v),A=I3.transform(d,x);A.toString()!==p.toString()&&(A.toString().length<=p.toString().length?p=A:d=T3(p.getAST()))});while(p.toString()!==y);return p},"optimize")}});var Xf=K((rY,N3)=>{"use strict";var j3="\u03B5",fE=j3+"*";N3.exports={EPSILON:j3,EPSILON_CLOSURE:fE}});var Qb=K((nY,q3)=>{"use strict";var dE=(function(){function t(e,r){var n=[],i=!0,s=!1,u=void 0;try{for(var a=e[Symbol.iterator](),c;!(i=(c=a.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(d){s=!0,u=d}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return n}return o(t,"sliceIterator"),function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),lE=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function pE(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(pE,"_toConsumableArray");function hE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(hE,"_classCallCheck");var D3=Xf(),yE=D3.EPSILON,B3=D3.EPSILON_CLOSURE,mE=(function(){function t(e,r){hE(this,t),this.in=e,this.out=r}return o(t,"NFA"),lE(t,[{key:"matches",value:o(function(r){return this.in.matches(r)},"matches")},{key:"getAlphabet",value:o(function(){if(!this._alphabet){this._alphabet=new Set;var r=this.getTransitionTable();for(var n in r){var i=r[n];for(var s in i)s!==B3&&this._alphabet.add(s)}}return this._alphabet},"getAlphabet")},{key:"getAcceptingStates",value:o(function(){return this._acceptingStates||this.getTransitionTable(),this._acceptingStates},"getAcceptingStates")},{key:"getAcceptingStateNumbers",value:o(function(){if(!this._acceptingStateNumbers){this._acceptingStateNumbers=new Set;var r=!0,n=!1,i=void 0;try{for(var s=this.getAcceptingStates()[Symbol.iterator](),u;!(r=(u=s.next()).done);r=!0){var a=u.value;this._acceptingStateNumbers.add(a.number)}}catch(c){n=!0,i=c}finally{try{!r&&s.return&&s.return()}finally{if(n)throw i}}}return this._acceptingStateNumbers},"getAcceptingStateNumbers")},{key:"getTransitionTable",value:o(function(){var r=this;if(!this._transitionTable){this._transitionTable={},this._acceptingStates=new Set;var n=new Set,i=new Set,s=o(function u(a){if(!n.has(a)){n.add(a),a.number=n.size,r._transitionTable[a.number]={},a.accepting&&r._acceptingStates.add(a);var c=a.getTransitions(),d=!0,p=!1,y=void 0;try{for(var v=c[Symbol.iterator](),x;!(d=(x=v.next()).done);d=!0){var A=x.value,B=dE(A,2),I=B[0],J=B[1],de=[];i.add(I);var fe=!0,ve=!1,Y=void 0;try{for(var ye=J[Symbol.iterator](),ae;!(fe=(ae=ye.next()).done);fe=!0){var Ne=ae.value;u(Ne),de.push(Ne.number)}}catch(xt){ve=!0,Y=xt}finally{try{!fe&&ye.return&&ye.return()}finally{if(ve)throw Y}}r._transitionTable[a.number][I]=de}}catch(xt){p=!0,y=xt}finally{try{!d&&v.return&&v.return()}finally{if(p)throw y}}}},"visitState");s(this.in),n.forEach(function(u){delete r._transitionTable[u.number][yE],r._transitionTable[u.number][B3]=[].concat(pE(u.getEpsilonClosure())).map(function(a){return a.number})})}return this._transitionTable},"getTransitionTable")}]),t})();q3.exports=mE});var U3=K((oY,M3)=>{"use strict";var gE=(function(){function t(e,r){var n=[],i=!0,s=!1,u=void 0;try{for(var a=e[Symbol.iterator](),c;!(i=(c=a.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(d){s=!0,u=d}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return n}return o(t,"sliceIterator"),function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();function vE(t){return Array.isArray(t)?t:Array.from(t)}o(vE,"_toArray");function Yb(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(Yb,"_toConsumableArray");var _n=null;function bE(t){var e=t.getTransitionTable(),r=Object.keys(e),n=t.getAlphabet(),i=t.getAcceptingStateNumbers();_n={};var s=new Set;r.forEach(function(Se){Se=Number(Se);var $=i.has(Se);$?_n[Se]=i:(s.add(Se),_n[Se]=s)});var u=[[s,i].filter(function(Se){return Se.size>0})],a=void 0,c=void 0;a=u[u.length-1],c=u[u.length-2];for(var d=o(function(){var $={},ft=!0,ir=!1,le=void 0;try{for(var or=a[Symbol.iterator](),Sr;!(ft=(Sr=or.next()).done);ft=!0){var Kr=Sr.value,sr={},dt=vE(Kr),Ra=dt[0],En=dt.slice(1);sr[Ra]=new Set([Ra]);var vo=!0,td=!1,bo=void 0;try{e:for(var wo=En[Symbol.iterator](),ja;!(vo=(ja=wo.next()).done);vo=!0){var Pn=ja.value,_o=!0,Na=!1,xo=void 0;try{for(var Ba=Object.keys(sr)[Symbol.iterator](),rd;!(_o=(rd=Ba.next()).done);_o=!0){var Da=rd.value;if(_E(Pn,Da,e,n)){sr[Da].add(Pn),sr[Pn]=sr[Da];continue e}}}catch(Dt){Na=!0,xo=Dt}finally{try{!_o&&Ba.return&&Ba.return()}finally{if(Na)throw xo}}sr[Pn]=new Set([Pn])}}catch(Dt){td=!0,bo=Dt}finally{try{!vo&&wo.return&&wo.return()}finally{if(td)throw bo}}Object.assign($,sr)}}catch(Dt){ir=!0,le=Dt}finally{try{!ft&&or.return&&or.return()}finally{if(ir)throw le}}_n=$;var Lp=new Set(Object.keys($).map(function(Dt){return $[Dt]}));u.push([].concat(Yb(Lp))),a=u[u.length-1],c=u[u.length-2]},"_loop");!wE(a,c);)d();var p=new Map,y=1;a.forEach(function(Se){return p.set(Se,y++)});var v={},x=new Set,A=o(function($,ft){var ir=!0,le=!1,or=void 0;try{for(var Sr=$[Symbol.iterator](),Kr;!(ir=(Kr=Sr.next()).done);ir=!0){var sr=Kr.value;i.has(sr)&&x.add(ft)}}catch(dt){le=!0,or=dt}finally{try{!ir&&Sr.return&&Sr.return()}finally{if(le)throw or}}},"updateAcceptingStates"),B=!0,I=!1,J=void 0;try{for(var de=p.entries()[Symbol.iterator](),fe;!(B=(fe=de.next()).done);B=!0){var ve=fe.value,Y=gE(ve,2),ye=Y[0],ae=Y[1];v[ae]={};var Ne=!0,xt=!1,at=void 0;try{for(var Bt=n[Symbol.iterator](),_r;!(Ne=(_r=Bt.next()).done);Ne=!0){var Fr=_r.value;A(ye,ae);var ct=void 0,xr=!0,kn=!1,li=void 0;try{for(var Ar=ye[Symbol.iterator](),Cn;!(xr=(Cn=Ar.next()).done);xr=!0){var nr=Cn.value;if(ct=e[nr][Fr],ct)break}}catch(Se){kn=!0,li=Se}finally{try{!xr&&Ar.return&&Ar.return()}finally{if(kn)throw li}}ct&&(v[ae][Fr]=p.get(_n[ct]))}}catch(Se){xt=!0,at=Se}finally{try{!Ne&&Bt.return&&Bt.return()}finally{if(xt)throw at}}}}catch(Se){I=!0,J=Se}finally{try{!B&&de.return&&de.return()}finally{if(I)throw J}}return t.setTransitionTable(v),t.setAcceptingStateNumbers(x),t}o(bE,"minimize");function wE(t,e){if(!e||t.length!==e.length)return!1;for(var r=0;r<t.length;r++){var n=t[r],i=e[r];if(n.size!==i.size||[].concat(Yb(n)).sort().join(",")!==[].concat(Yb(i)).sort().join(","))return!1}return!0}o(wE,"sameRow");function _E(t,e,r,n){var i=!0,s=!1,u=void 0;try{for(var a=n[Symbol.iterator](),c;!(i=(c=a.next()).done);i=!0){var d=c.value;if(!xE(t,e,r,d))return!1}}catch(p){s=!0,u=p}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return!0}o(_E,"areEquivalent");function xE(t,e,r,n){if(!_n[t]||!_n[e])return!1;var i=r[t][n],s=r[e][n];return!i&&!s?!0:_n[t].has(i)&&_n[e].has(s)}o(xE,"goToSameSet");M3.exports={minimize:bE}});var L3=K((uY,H3)=>{"use strict";var AE=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function $3(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o($3,"_toConsumableArray");function SE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(SE,"_classCallCheck");var kE=U3(),CE=Xf(),V3=CE.EPSILON_CLOSURE,EE=(function(){function t(e){SE(this,t),this._nfa=e}return o(t,"DFA"),AE(t,[{key:"minimize",value:o(function(){this.getTransitionTable(),this._originalAcceptingStateNumbers=this._acceptingStateNumbers,this._originalTransitionTable=this._transitionTable,kE.minimize(this)},"minimize")},{key:"getAlphabet",value:o(function(){return this._nfa.getAlphabet()},"getAlphabet")},{key:"getAcceptingStateNumbers",value:o(function(){return this._acceptingStateNumbers||this.getTransitionTable(),this._acceptingStateNumbers},"getAcceptingStateNumbers")},{key:"getOriginaAcceptingStateNumbers",value:o(function(){return this._originalAcceptingStateNumbers||this.getTransitionTable(),this._originalAcceptingStateNumbers},"getOriginaAcceptingStateNumbers")},{key:"setTransitionTable",value:o(function(r){this._transitionTable=r},"setTransitionTable")},{key:"setAcceptingStateNumbers",value:o(function(r){this._acceptingStateNumbers=r},"setAcceptingStateNumbers")},{key:"getTransitionTable",value:o(function(){var r=this;if(this._transitionTable)return this._transitionTable;var n=this._nfa.getTransitionTable(),i=Object.keys(n);this._acceptingStateNumbers=new Set;for(var s=n[i[0]][V3],u=[s],a=this.getAlphabet(),c=this._nfa.getAcceptingStateNumbers(),d={},p=o(function(Se){var $=!0,ft=!1,ir=void 0;try{for(var le=c[Symbol.iterator](),or;!($=(or=le.next()).done);$=!0){var Sr=or.value;if(Se.indexOf(Sr)!==-1){r._acceptingStateNumbers.add(Se.join(","));break}}}catch(Kr){ft=!0,ir=Kr}finally{try{!$&&le.return&&le.return()}finally{if(ft)throw ir}}},"updateAcceptingStates");u.length>0;){var y=u.shift(),v=y.join(",");d[v]={};var x=!0,A=!1,B=void 0;try{for(var I=a[Symbol.iterator](),J;!(x=(J=I.next()).done);x=!0){var de=J.value,fe=[];p(y);var ve=!0,Y=!1,ye=void 0;try{for(var ae=y[Symbol.iterator](),Ne;!(ve=(Ne=ae.next()).done);ve=!0){var xt=Ne.value,at=n[xt][de];if(at){var Bt=!0,_r=!1,Fr=void 0;try{for(var ct=at[Symbol.iterator](),xr;!(Bt=(xr=ct.next()).done);Bt=!0){var kn=xr.value;n[kn]&&fe.push.apply(fe,$3(n[kn][V3]))}}catch(nr){_r=!0,Fr=nr}finally{try{!Bt&&ct.return&&ct.return()}finally{if(_r)throw Fr}}}}}catch(nr){Y=!0,ye=nr}finally{try{!ve&&ae.return&&ae.return()}finally{if(Y)throw ye}}var li=new Set(fe),Ar=[].concat($3(li));if(Ar.length>0){var Cn=Ar.join(",");d[v][de]=Cn,d.hasOwnProperty(Cn)||u.unshift(Ar)}}}catch(nr){A=!0,B=nr}finally{try{!x&&I.return&&I.return()}finally{if(A)throw B}}}return this._transitionTable=this._remapStateNumbers(d)},"getTransitionTable")},{key:"_remapStateNumbers",value:o(function(r){var n={};this._originalTransitionTable=r;var i={};Object.keys(r).forEach(function(B,I){n[B]=I+1});for(var s in r){var u=r[s],a={};for(var c in u)a[c]=n[u[c]];i[n[s]]=a}this._originalAcceptingStateNumbers=this._acceptingStateNumbers,this._acceptingStateNumbers=new Set;var d=!0,p=!1,y=void 0;try{for(var v=this._originalAcceptingStateNumbers[Symbol.iterator](),x;!(d=(x=v.next()).done);d=!0){var A=x.value;this._acceptingStateNumbers.add(n[A])}}catch(B){p=!0,y=B}finally{try{!d&&v.return&&v.return()}finally{if(p)throw y}}return i},"_remapStateNumbers")},{key:"getOriginalTransitionTable",value:o(function(){return this._originalTransitionTable||this.getTransitionTable(),this._originalTransitionTable},"getOriginalTransitionTable")},{key:"matches",value:o(function(r){for(var n=1,i=0,s=this.getTransitionTable();r[i];)if(n=s[n][r[i++]],!n)return!1;return!!this.getAcceptingStateNumbers().has(n)},"matches")}]),t})();H3.exports=EE});var F3=K((cY,W3)=>{"use strict";var PE=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function TE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(TE,"_classCallCheck");var IE=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.accepting,n=r===void 0?!1:r;TE(this,t),this._transitions=new Map,this.accepting=n}return o(t,"State"),PE(t,[{key:"getTransitions",value:o(function(){return this._transitions},"getTransitions")},{key:"addTransition",value:o(function(r,n){return this.getTransitionsOnSymbol(r).add(n),this},"addTransition")},{key:"getTransitionsOnSymbol",value:o(function(r){var n=this._transitions.get(r);return n||(n=new Set,this._transitions.set(r,n)),n},"getTransitionsOnSymbol")}]),t})();W3.exports=IE});var J3=K((dY,K3)=>{"use strict";var OE=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function RE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(RE,"_classCallCheck");function jE(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}o(jE,"_possibleConstructorReturn");function NE(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}o(NE,"_inherits");var BE=F3(),DE=Xf(),e1=DE.EPSILON,qE=(function(t){NE(e,t);function e(){return RE(this,e),jE(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,"NFAState"),OE(e,[{key:"matches",value:o(function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;if(i.has(this))return!1;if(i.add(this),n.length===0){if(this.accepting)return!0;var s=!0,u=!1,a=void 0;try{for(var c=this.getTransitionsOnSymbol(e1)[Symbol.iterator](),d;!(s=(d=c.next()).done);s=!0){var p=d.value;if(p.matches("",i))return!0}}catch(at){u=!0,a=at}finally{try{!s&&c.return&&c.return()}finally{if(u)throw a}}return!1}var y=n[0],v=n.slice(1),x=this.getTransitionsOnSymbol(y),A=!0,B=!1,I=void 0;try{for(var J=x[Symbol.iterator](),de;!(A=(de=J.next()).done);A=!0){var fe=de.value;if(fe.matches(v))return!0}}catch(at){B=!0,I=at}finally{try{!A&&J.return&&J.return()}finally{if(B)throw I}}var ve=!0,Y=!1,ye=void 0;try{for(var ae=this.getTransitionsOnSymbol(e1)[Symbol.iterator](),Ne;!(ve=(Ne=ae.next()).done);ve=!0){var xt=Ne.value;if(xt.matches(n,i))return!0}}catch(at){Y=!0,ye=at}finally{try{!ve&&ae.return&&ae.return()}finally{if(Y)throw ye}}return!1},"matches")},{key:"getEpsilonClosure",value:o(function(){var n=this;return this._epsilonClosure||(function(){var i=n.getTransitionsOnSymbol(e1),s=n._epsilonClosure=new Set;s.add(n);var u=!0,a=!1,c=void 0;try{for(var d=i[Symbol.iterator](),p;!(u=(p=d.next()).done);u=!0){var y=p.value;if(!s.has(y)){s.add(y);var v=y.getEpsilonClosure();v.forEach(function(x){return s.add(x)})}}}catch(x){a=!0,c=x}finally{try{!u&&d.return&&d.return()}finally{if(a)throw c}}})(),this._epsilonClosure},"getEpsilonClosure")}]),e})(BE);K3.exports=qE});var t1=K((pY,G3)=>{"use strict";var Op=Qb(),Ea=J3(),ME=Xf(),Nt=ME.EPSILON;function z3(t){var e=new Ea,r=new Ea({accepting:!0});return new Op(e.addTransition(t,r),r)}o(z3,"char");function UE(){return z3(Nt)}o(UE,"e");function $E(t,e){return t.out.accepting=!1,e.out.accepting=!0,t.out.addTransition(Nt,e.in),new Op(t.in,e.out)}o($E,"altPair");function VE(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var i=!0,s=!1,u=void 0;try{for(var a=r[Symbol.iterator](),c;!(i=(c=a.next()).done);i=!0){var d=c.value;t=$E(t,d)}}catch(p){s=!0,u=p}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return t}o(VE,"alt");function HE(t,e){var r=new Ea,n=new Ea;return r.addTransition(Nt,t.in),r.addTransition(Nt,e.in),n.accepting=!0,t.out.accepting=!1,e.out.accepting=!1,t.out.addTransition(Nt,n),e.out.addTransition(Nt,n),new Op(r,n)}o(HE,"orPair");function LE(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var i=!0,s=!1,u=void 0;try{for(var a=r[Symbol.iterator](),c;!(i=(c=a.next()).done);i=!0){var d=c.value;t=HE(t,d)}}catch(p){s=!0,u=p}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return t}o(LE,"or");function WE(t){var e=new Ea,r=new Ea({accepting:!0});return e.addTransition(Nt,t.in),e.addTransition(Nt,r),t.out.accepting=!1,t.out.addTransition(Nt,r),r.addTransition(Nt,t.in),new Op(e,r)}o(WE,"repExplicit");function FE(t){return t.in.addTransition(Nt,t.out),t.out.addTransition(Nt,t.in),t}o(FE,"rep");function KE(t){return t.out.addTransition(Nt,t.in),t}o(KE,"plusRep");function JE(t){return t.in.addTransition(Nt,t.out),t}o(JE,"questionRep");G3.exports={alt:VE,char:z3,e:UE,or:LE,rep:FE,repExplicit:WE,plusRep:KE,questionRep:JE}});var Q3=K((yY,Z3)=>{"use strict";function zE(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(zE,"_toConsumableArray");var GE=zf(),Pa=t1(),XE=Pa.alt,ZE=Pa.char,QE=Pa.or,YE=Pa.rep,e6=Pa.plusRep,t6=Pa.questionRep;function xn(t){if(t&&!X3[t.type])throw new Error(t.type+" is not supported in NFA/DFA interpreter.");return t?X3[t.type](t):""}o(xn,"gen");var X3={RegExp:o(function(e){if(e.flags!=="")throw new Error("NFA/DFA: Flags are not supported yet.");return xn(e.body)},"RegExp"),Alternative:o(function(e){var r=(e.expressions||[]).map(xn);return XE.apply(void 0,zE(r))},"Alternative"),Disjunction:o(function(e){return QE(xn(e.left),xn(e.right))},"Disjunction"),Repetition:o(function(e){switch(e.quantifier.kind){case"*":return YE(xn(e.expression));case"+":return e6(xn(e.expression));case"?":return t6(xn(e.expression));default:throw new Error("Unknown repeatition: "+e.quantifier.kind+".")}},"Repetition"),Char:o(function(e){if(e.kind!=="simple")throw new Error("NFA/DFA: Only simple chars are supported yet.");return ZE(e.value)},"Char"),Group:o(function(e){return xn(e.expression)},"Group")};Z3.exports={build:o(function(e){var r=e;return e instanceof RegExp&&(e=""+e),typeof e=="string"&&(r=GE.parse(e,{captureLocations:!0})),xn(r)},"build")}});var t4=K((gY,e4)=>{"use strict";var r6=Qb(),Y3=L3(),n6=Q3(),i6=t1();e4.exports={NFA:r6,DFA:Y3,builders:i6,toNFA:o(function(e){return n6.build(e)},"toNFA"),toDFA:o(function(e){return new Y3(this.toNFA(e))},"toDFA"),test:o(function(e,r){return this.toDFA(e).matches(r)},"test")}});var n4=K((bY,r4)=>{"use strict";var o6=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function s6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(s6,"_classCallCheck");var u6=(function(){function t(e,r){var n=r.flags,i=r.groups,s=r.source;s6(this,t),this._re=e,this._groups=i,this.flags=n,this.source=s||e.source,this.dotAll=n.includes("s"),this.global=e.global,this.ignoreCase=e.ignoreCase,this.multiline=e.multiline,this.sticky=e.sticky,this.unicode=e.unicode}return o(t,"RegExpTree"),o6(t,[{key:"test",value:o(function(r){return this._re.test(r)},"test")},{key:"compile",value:o(function(r){return this._re.compile(r)},"compile")},{key:"toString",value:o(function(){return this._toStringResult||(this._toStringResult="/"+this.source+"/"+this.flags),this._toStringResult},"toString")},{key:"exec",value:o(function(r){var n=this._re.exec(r);if(!this._groups||!n)return n;n.groups={};for(var i in this._groups){var s=this._groups[i];n.groups[i]=n[s]}return n},"exec")}]),t})();r4.exports={RegExpTree:u6}});var u4=K((_Y,s4)=>{"use strict";var a6=PA(),c6=Bb(),f6=R3(),i4=zf(),o4=wp(),d6=Wb(),l6=t4(),p6=n4(),h6=p6.RegExpTree,y6={parser:i4,fa:l6,TransformResult:o4.TransformResult,parse:o(function(e,r){return i4.parse(""+e,r)},"parse"),traverse:o(function(e,r,n){return d6.traverse(e,r,n)},"traverse"),transform:o(function(e,r){return o4.transform(e,r)},"transform"),generate:o(function(e){return c6.generate(e)},"generate"),toRegExp:o(function(e){var r=this.compatTranspile(e);return new RegExp(r.getSource(),r.getFlags())},"toRegExp"),optimize:o(function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.blacklist;return f6.optimize(e,{whitelist:r,blacklist:i})},"optimize"),compatTranspile:o(function(e,r){return a6.transform(e,r)},"compatTranspile"),exec:o(function(e,r){if(typeof e=="string"){var n=this.compatTranspile(e),i=n.getExtra();i.namedCapturingGroups?e=new h6(n.toRegExp(),{flags:n.getFlags(),source:n.getSource(),groups:i.namedCapturingGroups}):e=n.toRegExp()}return e.exec(r)},"exec")};s4.exports=y6});var c4=K((AY,a4)=>{"use strict";a4.exports=u4()});var d4=K((SY,f4)=>{"use strict";var Rp=c4(),m6=Nb(),n1=class n1 extends m6.Analyzer{constructor(e){super(e)}isVulnerable(e){return this._measureStarHeight(e)>1||this._measureRepetitions(e)>this.options.heuristic_replimit}genAttackString(e){return null}_measureStarHeight(e){let r=0,n=0,i=Rp.parse(e);return Rp.traverse(i,{Repetition:{pre({node:s}){r++,n<r&&(n=r)},post({node:s}){r--}}}),n}_measureRepetitions(e){let r=0,n=Rp.parse(e);return Rp.traverse(n,{Repetition:{pre({node:i}){r++}}}),r}};o(n1,"HeuristicAnalyzer");var r1=n1;f4.exports=r1});var p4=K((CY,l4)=>{"use strict";var g6=d4();l4.exports=[g6]});var y4=K((EY,h4)=>{"use strict";var v6=Nb(),b6=p4(),w6=25,_6=!0,x6=!1,o1=class o1{constructor(e,r){this.regExp=e,this.analyzerOptions=r}};o(o1,"Args");var i1=o1;function A6(t,e){try{let r=S6(t,e);return k6(r).find(i=>i)?x6:_6}catch{return!1}}o(A6,"safeRegex");function S6(t,e){e||(e={});let r=e.limit===void 0?w6:e.limit,n=new v6.AnalyzerOptions(r),i=null;return t instanceof RegExp?i=t:typeof t=="string"?i=new RegExp(t):i=new RegExp(String(t)),new i1(i,n)}o(S6,"buildArgs");function k6(t){let e=[],r;for(r of b6)try{let n=new r(t.analyzerOptions);e.push(n.isVulnerable(t.regExp))}catch{e.push(!1)}return e}o(k6,"askAnalyzersIfVulnerable");h4.exports=A6});var gP={};E1(gP,{AUTHORIZATION_CODE_GRANT:()=>Mh,BuildDcqlPresentationError:()=>Sn,BuildPresentationError:()=>fi,CREDENTIAL_OFFER_SCHEMES:()=>V4,CredentialOfferParseError:()=>ge,DEFAULT_JWE_ALG:()=>d1,DEFAULT_JWE_ENC:()=>l1,DEFAULT_STORE_PLUGIN:()=>Sw,JarmEncryptError:()=>ze,OID4VCI_PROOF_TYP:()=>vw,PRE_AUTHORIZED_CODE_GRANT:()=>Tn,PkceError:()=>On,RequestObjectError:()=>Z,SiopSignError:()=>An,VciError:()=>N,VpError:()=>te,VpSignError:()=>Lt,VpSubmitError:()=>Wt,acceptCredentialOffer:()=>_d,adaptCredentialForDcql:()=>g1,adaptCredentialsForDcql:()=>Mp,assembleDcqlVpToken:()=>w1,beginAuthCodeFlow:()=>Uh,buildAuthorizationUrl:()=>_w,buildDcqlPresentations:()=>$p,buildDcqlQuery:()=>k1,buildDcqlResponse:()=>Vp,buildPresentation:()=>Qf,buildPresentationSubmission:()=>x4,buildProofJwt:()=>Za,builtInDidResolver:()=>Cb,completeAuthCodeFlow:()=>$h,computeS256Challenge:()=>Dh,createJoseEd25519Signer:()=>wd,encryptResponseObject:()=>Dp,evaluateField:()=>u1,exchangeAuthorizationCode:()=>xw,exchangePreAuthorizedCode:()=>Gp,fetchAuthorizationServerMetadata:()=>Ua,fetchCredentialIssuerMetadata:()=>Ma,generatePkcePair:()=>Bh,getOpenID4VCPlugin:()=>E4,inferCredentialFormat:()=>Zf,matchInputDescriptor:()=>Np,normalizeCredentialOffer:()=>nd,normalizeIssuedCredential:()=>Vh,parseAuthorizationRequestUri:()=>Lf,parseCredentialOfferUri:()=>id,parseDcqlQuery:()=>ai,queryJsonPath:()=>a1,requestCredential:()=>Qa,requestW3cVc:()=>T4,requiresIdToken:()=>qp,resolveAuthorizationRequest:()=>Wf,resolveAuthorizationServer:()=>$a,resolveCredentialOfferByReference:()=>Kp,resolvePresentationDefinitionByReference:()=>Pb,responseTypeSet:()=>y1,satisfiesFilter:()=>Ta,selectCredentials:()=>Bp,selectCredentialsForDcql:()=>Up,signDcqlPresentations:()=>b1,signIdToken:()=>ed,signPresentation:()=>di,storeAcceptedCredentials:()=>Hh,submitPresentation:()=>Ia,verifyAndDecodeRequestObject:()=>lp,verifyPkce:()=>DS});module.exports=$4(gP);var Tn="urn:ietf:params:oauth:grant-type:pre-authorized_code",V4=["openid-credential-offer","haip"],Fp=class Fp extends Error{constructor(e,r){super(r),this.name="CredentialOfferParseError",this.code=e}};o(Fp,"CredentialOfferParseError");var ge=Fp;var Jr=o(t=>typeof t=="string"&&t.length>0,"isNonEmptyString"),nd=o(t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new ge("invalid_json","Credential offer must be a JSON object");let e=t;if(!Jr(e.credential_issuer))throw new ge("missing_issuer","Credential offer is missing `credential_issuer`");let r=e.credential_issuer;if(Array.isArray(e.credential_configuration_ids)){let n=e.credential_configuration_ids.filter(Jr);if(n.length===0)throw new ge("missing_credentials","Credential offer `credential_configuration_ids` is empty");return{credential_issuer:r,credential_configuration_ids:n,grants:T1(e.grants)}}if(Array.isArray(e.credentials)){let i=e.credentials.map(s=>{if(typeof s=="string")return s;if(typeof s=="object"&&s!==null){let u=s;if(Jr(u.id))return u.id;if(Array.isArray(u.types)&&u.types.length>0&&Jr(u.types[0]))return u.types[0]}return null}).filter(Jr);if(i.length===0)throw new ge("missing_credentials","Credential offer `credentials` array did not contain any resolvable identifiers");return{credential_issuer:r,credential_configuration_ids:i,grants:T1(e.grants,{legacy:!0})}}throw new ge("missing_credentials","Credential offer must include `credential_configuration_ids` (Draft 13) or `credentials` (Draft 11)")},"normalizeCredentialOffer"),T1=o((t,e={})=>{if(t==null)return;if(typeof t!="object"||Array.isArray(t))throw new ge("invalid_grants","`grants` must be a JSON object");let r=t,n={},i=r[Tn];if(i&&typeof i=="object"&&!Array.isArray(i)){let u=i,a=u["pre-authorized_code"];if(!Jr(a))throw new ge("invalid_grants","Pre-authorized code grant is missing `pre-authorized_code`");let c={"pre-authorized_code":a,interval:typeof u.interval=="number"?u.interval:void 0,authorization_server:Jr(u.authorization_server)?u.authorization_server:void 0};u.tx_code&&typeof u.tx_code=="object"&&!Array.isArray(u.tx_code)?c.tx_code=u.tx_code:e.legacy&&u.user_pin_required===!0&&(c.tx_code={}),n[Tn]=c}let s=r.authorization_code;if(s&&typeof s=="object"&&!Array.isArray(s)){let u=s;n.authorization_code={issuer_state:Jr(u.issuer_state)?u.issuer_state:void 0,authorization_server:Jr(u.authorization_server)?u.authorization_server:void 0}}if(Object.keys(n).length!==0)return n},"normalizeGrants");var id=o(t=>{if(typeof t!="string"||t.trim().length===0)throw new ge("invalid_uri","Offer URI must be a non-empty string");let e=H4(t.trim()),r=e.get("credential_offer"),n=e.get("credential_offer_uri");if(r&&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(!I1(n))throw new ge("invalid_uri","`credential_offer_uri` must be an absolute https:// URL");return{kind:"by_reference",uri:n}}if(r){let i;try{i=JSON.parse(r)}catch{throw new ge("invalid_json","`credential_offer` value is not valid JSON")}return{kind:"by_value",offer:nd(i)}}throw new ge("missing_offer","Credential offer URI must contain `credential_offer` or `credential_offer_uri`")},"parseCredentialOfferUri"),Kp=o(async(t,e=globalThis.fetch)=>{if(typeof e!="function")throw new ge("invalid_uri","No fetch implementation available to resolve credential_offer_uri");if(!I1(t))throw new ge("invalid_uri","credential_offer_uri must be an absolute https:// URL");let r;try{r=await e(t,{method:"GET"})}catch(i){throw new ge("invalid_uri",`Failed to fetch credential_offer_uri: ${i instanceof Error?i.message:String(i)}`)}if(!r.ok)throw new ge("invalid_uri",`credential_offer_uri returned ${r.status} ${r.statusText}`);let n;try{n=await r.json()}catch{throw new ge("invalid_json","credential_offer_uri response was not valid JSON")}return{kind:"by_value",offer:nd(n)}},"resolveCredentialOfferByReference"),H4=o(t=>{let e=t.indexOf("?");if(e!==-1)return new URLSearchParams(t.slice(e+1));if(t.includes("://")||/^[a-z][a-z0-9+.-]*:/i.test(t))throw new ge("invalid_uri","Offer URI has no query string");if(t.includes("="))return new URLSearchParams(t);throw new ge("invalid_uri","Offer URI has no query string")},"extractSearchParams"),I1=o(t=>{try{return new URL(t).protocol==="https:"}catch{return!1}},"isHttpsUrl");var Jp=class Jp extends Error{constructor(e,r,n={}){super(r),this.name="VciError",this.code=e,this.status=n.status,this.body=n.body,n.cause!==void 0&&(this.cause=n.cause)}};o(Jp,"VciError");var N=Jp;var L4="/.well-known/openid-credential-issuer",W4="/.well-known/oauth-authorization-server",F4="/.well-known/openid-configuration",Ma=o(async(t,e=globalThis.fetch)=>{if(typeof e!="function")throw new N("metadata_fetch_failed","No fetch implementation available for issuer metadata");let r=zp(t,L4),n=await z4(r,e,"metadata_fetch_failed");if(!R1(n))throw new N("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 N("metadata_invalid","Issuer metadata is missing `credential_issuer`",{body:n});if(typeof n.credential_endpoint!="string"||n.credential_endpoint.length===0)throw new N("metadata_invalid","Issuer metadata is missing `credential_endpoint`",{body:n});if(!K4(n.credential_issuer,t))throw new N("metadata_issuer_mismatch",`Issuer metadata advertises \`credential_issuer\` as ${n.credential_issuer} but was fetched for ${t}`,{body:n});return n},"fetchCredentialIssuerMetadata"),Ua=o(async(t,e=globalThis.fetch)=>{if(typeof e!="function")throw new N("metadata_fetch_failed","No fetch implementation available for authorization-server metadata");let r=zp(t,W4),n=o(async s=>{let u;try{u=await e(s,{method:"GET"})}catch{return null}if(!u.ok)return null;try{return await u.json()}catch{return null}},"tryUrl"),i=await n(r);if(i==null){let s=zp(t,F4);i=await n(s)}if(i==null)throw new N("metadata_fetch_failed",`Authorization server metadata not reachable at ${r} or the OIDC fallback`);if(!R1(i))throw new N("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 N("metadata_invalid","Authorization server metadata is missing `token_endpoint`",{body:i});return i},"fetchAuthorizationServerMetadata"),$a=o((t,e)=>e&&e.length>0?e:Array.isArray(t.authorization_servers)&&t.authorization_servers.length>0&&typeof t.authorization_servers[0]=="string"?t.authorization_servers[0]:t.credential_issuer,"resolveAuthorizationServer"),zp=o((t,e)=>{let r=t.length;for(;r>0&&t.charCodeAt(r-1)===47;)r--;return`${t.slice(0,r)}${e}`},"joinWellKnown"),K4=o((t,e)=>O1(t)===O1(e),"originsMatch"),O1=o(t=>{let e=t.length;for(;e>0&&t.charCodeAt(e-1)===47;)e--;let r=t.slice(0,e),n=r.indexOf("://");if(n<=0)return r;let i=r.slice(0,n);return J4(i)?`${i.toLowerCase()}${r.slice(n)}`:r},"normalizeIssuerId"),J4=o(t=>{if(t.length===0)return!1;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),n=r>=65&&r<=90,i=r>=97&&r<=122;if(!n&&!i)return!1}return!0},"isAsciiAlpha"),R1=o(t=>typeof t=="object"&&t!==null&&!Array.isArray(t),"isObject"),z4=o(async(t,e,r)=>{let n;try{n=await e(t,{method:"GET"})}catch(i){throw new N(r,`Failed to fetch ${t}: ${i instanceof Error?i.message:String(i)}`,{cause:i})}if(!n.ok)throw new N(r,`Fetch of ${t} returned ${n.status} ${n.statusText}`,{status:n.status});try{return await n.json()}catch(i){throw new N(r,`Response from ${t} was not valid JSON`,{cause:i})}},"getJson");var Gp=o(async t=>{let{tokenEndpoint:e,preAuthorizedCode:r,txCode:n,clientId:i}=t,s=t.fetchImpl??globalThis.fetch;if(typeof s!="function")throw new N("token_request_failed","No fetch implementation available for token exchange");let u=new URLSearchParams;u.set("grant_type",Tn),u.set("pre-authorized_code",r),typeof n=="string"&&n.length>0&&u.set("tx_code",n),typeof i=="string"&&i.length>0&&u.set("client_id",i);let a;try{a=await s(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:u.toString()})}catch(d){throw new N("token_request_failed",`Token endpoint ${e} unreachable: ${d instanceof Error?d.message:String(d)}`,{cause:d})}let c;try{c=await a.json()}catch(d){throw new N("token_response_invalid",`Token endpoint ${e} returned non-JSON body`,{status:a.status,cause:d})}if(!a.ok){let d=c,p=typeof d?.error=="string"?d.error:"unknown",y=typeof d?.error_description=="string"?`: ${d.error_description}`:"";throw new N("token_request_failed",`Token endpoint returned ${a.status} (${p})${y}`,{status:a.status,body:c})}if(!G4(c))throw new N("token_response_invalid","Token endpoint response is missing required `access_token` / `token_type`",{status:a.status,body:c});return c},"exchangePreAuthorizedCode"),G4=o(t=>{if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.access_token=="string"&&e.access_token.length>0&&typeof e.token_type=="string"&&e.token_type.length>0},"isTokenResponse");var ee=crypto,Me=o(t=>t instanceof CryptoKey,"isCryptoKey");var X4=o(async(t,e)=>{let r=`SHA-${t.slice(-3)}`;return new Uint8Array(await ee.subtle.digest(r,e))},"digest"),j1=X4;var Te=new TextEncoder,Ge=new TextDecoder,od=2**32;function Ft(...t){let e=t.reduce((i,{length:s})=>i+s,0),r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}o(Ft,"concat");function N1(t,e){return Ft(Te.encode(t),new Uint8Array([0]),e)}o(N1,"p2s");function Xp(t,e,r){if(e<0||e>=od)throw new RangeError(`value must be >= 0 and <= ${od-1}. Received ${e}`);t.set([e>>>24,e>>>16,e>>>8,e&255],r)}o(Xp,"writeUInt32BE");function B1(t){let e=Math.floor(t/od),r=t%od,n=new Uint8Array(8);return Xp(n,e,0),Xp(n,r,4),n}o(B1,"uint64be");function sd(t){let e=new Uint8Array(4);return Xp(e,t),e}o(sd,"uint32be");function ud(t){return Ft(sd(t.length),t)}o(ud,"lengthAndInput");async function D1(t,e,r){let n=Math.ceil((e>>3)/32),i=new Uint8Array(n*32);for(let s=0;s<n;s++){let u=new Uint8Array(4+t.length+r.length);u.set(sd(s+1)),u.set(t,4),u.set(r,4+t.length),i.set(await j1("sha256",u),s*32)}return i.slice(0,e>>3)}o(D1,"concatKdf");var Zp=o(t=>{let e=t;typeof e=="string"&&(e=Te.encode(e));let r=32768,n=[];for(let i=0;i<e.length;i+=r)n.push(String.fromCharCode.apply(null,e.subarray(i,i+r)));return btoa(n.join(""))},"encodeBase64"),Ie=o(t=>Zp(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),"encode"),Qp=o(t=>{let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r},"decodeBase64"),Kt=o(t=>{let e=t;e instanceof Uint8Array&&(e=Ge.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Qp(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}},"decode");var oh=class oh extends Error{constructor(e,r){super(e,r),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};o(oh,"JOSEError");var Xe=oh;Xe.code="ERR_JOSE_GENERIC";var sh=class sh extends Xe{constructor(e,r,n="unspecified",i="unspecified"){super(e,{cause:{claim:n,reason:i,payload:r}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=n,this.reason=i,this.payload=r}};o(sh,"JWTClaimValidationFailed");var At=sh;At.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var uh=class uh extends Xe{constructor(e,r,n="unspecified",i="unspecified"){super(e,{cause:{claim:n,reason:i,payload:r}}),this.code="ERR_JWT_EXPIRED",this.claim=n,this.reason=i,this.payload=r}};o(uh,"JWTExpired");var Ao=uh;Ao.code="ERR_JWT_EXPIRED";var ah=class ah extends Xe{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}};o(ah,"JOSEAlgNotAllowed");var Va=ah;Va.code="ERR_JOSE_ALG_NOT_ALLOWED";var ch=class ch extends Xe{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}};o(ch,"JOSENotSupported");var pe=ch;pe.code="ERR_JOSE_NOT_SUPPORTED";var fh=class fh extends Xe{constructor(e="decryption operation failed",r){super(e,r),this.code="ERR_JWE_DECRYPTION_FAILED"}};o(fh,"JWEDecryptionFailed");var Yp=fh;Yp.code="ERR_JWE_DECRYPTION_FAILED";var dh=class dh extends Xe{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}};o(dh,"JWEInvalid");var lt=dh;lt.code="ERR_JWE_INVALID";var lh=class lh extends Xe{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}};o(lh,"JWSInvalid");var me=lh;me.code="ERR_JWS_INVALID";var ph=class ph extends Xe{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}};o(ph,"JWTInvalid");var Ze=ph;Ze.code="ERR_JWT_INVALID";var hh=class hh extends Xe{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}};o(hh,"JWKInvalid");var eh=hh;eh.code="ERR_JWK_INVALID";var yh=class yh extends Xe{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}};o(yh,"JWKSInvalid");var th=yh;th.code="ERR_JWKS_INVALID";var mh=class mh extends Xe{constructor(e="no applicable key found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_NO_MATCHING_KEY"}};o(mh,"JWKSNoMatchingKey");var rh=mh;rh.code="ERR_JWKS_NO_MATCHING_KEY";var gh=class gh extends Xe{constructor(e="multiple matching keys found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}};o(gh,"JWKSMultipleMatchingKeys");var nh=gh;nh.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var vh=class vh extends Xe{constructor(e="request timed out",r){super(e,r),this.code="ERR_JWKS_TIMEOUT"}};o(vh,"JWKSTimeout");var ih=vh;ih.code="ERR_JWKS_TIMEOUT";var bh=class bh extends Xe{constructor(e="signature verification failed",r){super(e,r),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}};o(bh,"JWSSignatureVerificationFailed");var Ha=bh;Ha.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";var So=ee.getRandomValues.bind(ee);function wh(t){switch(t){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 pe(`Unsupported JWE Algorithm: ${t}`)}}o(wh,"bitLength");var q1=o(t=>So(new Uint8Array(wh(t)>>3)),"default");var Y4=o((t,e)=>{if(e.length<<3!==wh(t))throw new lt("Invalid Initialization Vector length")},"checkIvLength"),M1=Y4;var eS=o((t,e)=>{let r=t.byteLength<<3;if(r!==e)throw new lt(`Invalid Content Encryption Key length. Expected ${e} bits, got ${r} bits`)},"checkCekLength"),_h=eS;function Je(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}o(Je,"unusable");function zr(t,e){return t.name===e}o(zr,"isAlgorithm");function ad(t){return parseInt(t.name.slice(4),10)}o(ad,"getHashLength");function tS(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}o(tS,"getNamedCurve");function U1(t,e){if(e.length&&!e.some(r=>t.usages.includes(r))){let r="CryptoKey does not support this operation, its usages must include ";if(e.length>2){let n=e.pop();r+=`one of ${e.join(", ")}, or ${n}.`}else e.length===2?r+=`one of ${e[0]} or ${e[1]}.`:r+=`${e[0]}.`;throw new TypeError(r)}}o(U1,"checkUsage");function $1(t,e,...r){switch(e){case"HS256":case"HS384":case"HS512":{if(!zr(t.algorithm,"HMAC"))throw Je("HMAC");let n=parseInt(e.slice(2),10);if(ad(t.algorithm.hash)!==n)throw Je(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!zr(t.algorithm,"RSASSA-PKCS1-v1_5"))throw Je("RSASSA-PKCS1-v1_5");let n=parseInt(e.slice(2),10);if(ad(t.algorithm.hash)!==n)throw Je(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!zr(t.algorithm,"RSA-PSS"))throw Je("RSA-PSS");let n=parseInt(e.slice(2),10);if(ad(t.algorithm.hash)!==n)throw Je(`SHA-${n}`,"algorithm.hash");break}case"EdDSA":{if(t.algorithm.name!=="Ed25519"&&t.algorithm.name!=="Ed448")throw Je("Ed25519 or Ed448");break}case"Ed25519":{if(!zr(t.algorithm,"Ed25519"))throw Je("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!zr(t.algorithm,"ECDSA"))throw Je("ECDSA");let n=tS(e);if(t.algorithm.namedCurve!==n)throw Je(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}U1(t,r)}o($1,"checkSigCryptoKey");function ar(t,e,...r){switch(e){case"A128GCM":case"A192GCM":case"A256GCM":{if(!zr(t.algorithm,"AES-GCM"))throw Je("AES-GCM");let n=parseInt(e.slice(1,4),10);if(t.algorithm.length!==n)throw Je(n,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!zr(t.algorithm,"AES-KW"))throw Je("AES-KW");let n=parseInt(e.slice(1,4),10);if(t.algorithm.length!==n)throw Je(n,"algorithm.length");break}case"ECDH":{switch(t.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Je("ECDH, X25519, or X448")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!zr(t.algorithm,"PBKDF2"))throw Je("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!zr(t.algorithm,"RSA-OAEP"))throw Je("RSA-OAEP");let n=parseInt(e.slice(9),10)||1;if(ad(t.algorithm.hash)!==n)throw Je(`SHA-${n}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}U1(t,r)}o(ar,"checkEncCryptoKey");function V1(t,e,...r){if(r=r.filter(Boolean),r.length>2){let n=r.pop();t+=`one of type ${r.join(", ")}, or ${n}.`}else r.length===2?t+=`one of type ${r[0]} or ${r[1]}.`:t+=`of type ${r[0]}.`;return e==null?t+=` Received ${e}`:typeof e=="function"&&e.name?t+=` Received function ${e.name}`:typeof e=="object"&&e!=null&&e.constructor?.name&&(t+=` Received an instance of ${e.constructor.name}`),t}o(V1,"message");var Fe=o((t,...e)=>V1("Key must be ",t,...e),"default");function xh(t,e,...r){return V1(`Key for the ${t} algorithm must be `,e,...r)}o(xh,"withAlg");var Ah=o(t=>Me(t)?!0:t?.[Symbol.toStringTag]==="KeyObject","default"),qe=["CryptoKey"];var rS=o((...t)=>{let e=t.filter(Boolean);if(e.length===0||e.length===1)return!0;let r;for(let n of e){let i=Object.keys(n);if(!r||r.size===0){r=new Set(i);continue}for(let s of i){if(r.has(s))return!1;r.add(s)}}return!0},"isDisjoint"),ko=rS;function nS(t){return typeof t=="object"&&t!==null}o(nS,"isObjectLike");function nt(t){if(!nS(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}o(nt,"isObject");var iS=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]],cd=iS;function oS(t,e){if(t.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${e}`)}o(oS,"checkKeySize");function sS(t,e,r){if(Me(t))return ar(t,e,r),t;if(t instanceof Uint8Array)return ee.subtle.importKey("raw",t,"AES-KW",!0,[r]);throw new TypeError(Fe(t,...qe,"Uint8Array"))}o(sS,"getCryptoKey");var La=o(async(t,e,r)=>{let n=await sS(e,t,"wrapKey");oS(n,t);let i=await ee.subtle.importKey("raw",r,...cd);return new Uint8Array(await ee.subtle.wrapKey("raw",i,n,"AES-KW"))},"wrap");async function H1(t,e,r,n,i=new Uint8Array(0),s=new Uint8Array(0)){if(!Me(t))throw new TypeError(Fe(t,...qe));if(ar(t,"ECDH"),!Me(e))throw new TypeError(Fe(e,...qe));ar(e,"ECDH","deriveBits");let u=Ft(ud(Te.encode(r)),ud(i),ud(s),sd(n)),a;t.algorithm.name==="X25519"?a=256:t.algorithm.name==="X448"?a=448:a=Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3),10)/8)<<3;let c=new Uint8Array(await ee.subtle.deriveBits({name:t.algorithm.name,public:t},e,a));return D1(c,n,u)}o(H1,"deriveKey");async function L1(t){if(!Me(t))throw new TypeError(Fe(t,...qe));return ee.subtle.generateKey(t.algorithm,!0,["deriveBits"])}o(L1,"generateEpk");function W1(t){if(!Me(t))throw new TypeError(Fe(t,...qe));return["P-256","P-384","P-521"].includes(t.algorithm.namedCurve)||t.algorithm.name==="X25519"||t.algorithm.name==="X448"}o(W1,"ecdhAllowed");function Sh(t){if(!(t instanceof Uint8Array)||t.length<8)throw new lt("PBES2 Salt Input must be 8 or more octets")}o(Sh,"checkP2s");function aS(t,e){if(t instanceof Uint8Array)return ee.subtle.importKey("raw",t,"PBKDF2",!1,["deriveBits"]);if(Me(t))return ar(t,e,"deriveBits","deriveKey"),t;throw new TypeError(Fe(t,...qe,"Uint8Array"))}o(aS,"getCryptoKey");async function cS(t,e,r,n){Sh(t);let i=N1(e,t),s=parseInt(e.slice(13,16),10),u={hash:`SHA-${e.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},a={length:s,name:"AES-KW"},c=await aS(n,e);if(c.usages.includes("deriveBits"))return new Uint8Array(await ee.subtle.deriveBits(u,c,s));if(c.usages.includes("deriveKey"))return ee.subtle.deriveKey(u,c,a,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}o(cS,"deriveKey");var F1=o(async(t,e,r,n=2048,i=So(new Uint8Array(16)))=>{let s=await cS(i,t,n,e);return{encryptedKey:await La(t.slice(-6),s,r),p2c:n,p2s:Ie(i)}},"encrypt");function fd(t){switch(t){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new pe(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}o(fd,"subtleRsaEs");var Co=o((t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){let{modulusLength:r}=e.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}},"default");var K1=o(async(t,e,r)=>{if(!Me(e))throw new TypeError(Fe(e,...qe));if(ar(e,t,"encrypt","wrapKey"),Co(t,e),e.usages.includes("encrypt"))return new Uint8Array(await ee.subtle.encrypt(fd(t),e,r));if(e.usages.includes("wrapKey")){let n=await ee.subtle.importKey("raw",r,...cd);return new Uint8Array(await ee.subtle.wrapKey("raw",n,e,fd(t)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},"encrypt");function Gr(t){return nt(t)&&typeof t.kty=="string"}o(Gr,"isJWK");function J1(t){return t.kty!=="oct"&&typeof t.d=="string"}o(J1,"isPrivateJWK");function z1(t){return t.kty!=="oct"&&typeof t.d>"u"}o(z1,"isPublicJWK");function G1(t){return Gr(t)&&t.kty==="oct"&&typeof t.k=="string"}o(G1,"isSecretJWK");function dS(t){let e,r;switch(t.kty){case"RSA":{switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`},r=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`},r=t.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(t.alg.slice(-3),10)||1}`},r=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new pe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},r=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},r=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},r=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},r=t.d?["deriveBits"]:[];break;default:throw new pe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(t.alg){case"Ed25519":e={name:"Ed25519"},r=t.d?["sign"]:["verify"];break;case"EdDSA":e={name:t.crv},r=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv},r=t.d?["deriveBits"]:[];break;default:throw new pe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new pe('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:r}}o(dS,"subtleMapping");var lS=o(async t=>{if(!t.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:e,keyUsages:r}=dS(t),n=[e,t.ext??!1,t.key_ops??r],i={...t};return delete i.alg,delete i.use,ee.subtle.importKey("jwk",i,...n)},"parse"),dd=lS;var X1=o(t=>Kt(t),"exportKeyValue"),Eo,Po,Z1=o(t=>t?.[Symbol.toStringTag]==="KeyObject","isKeyObject"),ld=o(async(t,e,r,n,i=!1)=>{let s=t.get(e);if(s?.[n])return s[n];let u=await dd({...r,alg:n});return i&&Object.freeze(e),s?s[n]=u:t.set(e,{[n]:u}),u},"importAndCache"),pS=o((t,e)=>{if(Z1(t)){let r=t.export({format:"jwk"});return delete r.d,delete r.dp,delete r.dq,delete r.p,delete r.q,delete r.qi,r.k?X1(r.k):(Po||(Po=new WeakMap),ld(Po,t,r,e))}return Gr(t)?t.k?Kt(t.k):(Po||(Po=new WeakMap),ld(Po,t,t,e,!0)):t},"normalizePublicKey"),hS=o((t,e)=>{if(Z1(t)){let r=t.export({format:"jwk"});return r.k?X1(r.k):(Eo||(Eo=new WeakMap),ld(Eo,t,r,e))}return Gr(t)?t.k?Kt(t.k):(Eo||(Eo=new WeakMap),ld(Eo,t,t,e,!0)):t},"normalizePrivateKey"),Wa={normalizePublicKey:pS,normalizePrivateKey:hS};function kh(t){switch(t){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 pe(`Unsupported JWE Algorithm: ${t}`)}}o(kh,"bitLength");var To=o(t=>So(new Uint8Array(kh(t)>>3)),"default");var Q1=o((t,e)=>{let r=(t.match(/.{1,64}/g)||[]).join(`
|
|
6
|
+
`}throw new SyntaxError(s+'Unexpected token: "'+e+'" '+("at "+r+":"+n+"."))},"throwUnexpectedToken"),getCursor:o(function(){return this._cursor},"getCursor"),getCurrentLine:o(function(){return this._currentLine},"getCurrentLine"),getCurrentColumn:o(function(){return this._currentColumn},"getCurrentColumn"),_captureLocation:o(function(e){var r=/\n/g;this._tokenStartOffset=this._cursor,this._tokenStartLine=this._currentLine,this._tokenStartColumn=this._tokenStartOffset-this._currentLineBeginOffset;for(var n=void 0;(n=r.exec(e))!==null;)this._currentLine++,this._currentLineBeginOffset=this._tokenStartOffset+n.index+1;this._tokenEndOffset=this._cursor+e.length,this._tokenEndLine=this._currentLine,this._tokenEndColumn=this._currentColumn=this._tokenEndOffset-this._currentLineBeginOffset},"_captureLocation"),_toToken:o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return{type:e,value:r,startOffset:this._tokenStartOffset,endOffset:this._tokenEndOffset,startLine:this._tokenStartLine,endLine:this._tokenEndLine,startColumn:this._tokenStartColumn,endColumn:this._tokenEndColumn}},"_toToken"),isEOF:o(function(){return this._cursor===this._string.length},"isEOF"),hasMoreTokens:o(function(){return this._cursor<=this._string.length},"hasMoreTokens"),_match:o(function(e,r){var n=e.match(r);return n?(this._captureLocation(n[0]),this._cursor+=n[0].length,n[0]):null},"_match"),onToken:o(function(e){return e},"onToken")};Je.lexer=Yt;Je.tokenizer=Yt;Je.options={captureLocations:!0};var Io={setOptions:o(function(e){return Je.options=e,this},"setOptions"),getOptions:o(function(){return Je.options},"getOptions"),parse:o(function(e,r){if(!Yt)throw new Error("Tokenizer instance wasn't specified.");Yt.initString(e);var n=Je.options;r&&(Je.options=Object.assign({},Je.options,r)),Io.onParseBegin(e,Yt,Je.options),Pt.length=0,Pt.push(0);var i=Yt.getNextToken(),s=null;do{i||(Je.options=n,t3());var u=Pt[Pt.length-1],a=FA[i.type];g1[u].hasOwnProperty(a)||(Je.options=n,GA(i));var c=g1[u][a];if(c[0]==="s"){var d=null;Je.options.captureLocations&&(d={startOffset:i.startOffset,endOffset:i.endOffset,startLine:i.startLine,endLine:i.endLine,startColumn:i.startColumn,endColumn:i.endColumn}),s=this.onShift(i),Pt.push({symbol:FA[s.type],semanticValue:s.value,loc:d},Number(c.slice(1))),i=Yt.getNextToken()}else if(c[0]==="r"){var h=c.slice(1),y=CE[h],b=typeof y[2]=="function",A=b?[]:null,S=b&&Je.options.captureLocations?[]:null;if(y[1]!==0)for(var D=y[1];D-- >0;){Pt.pop();var I=Pt.pop();b&&(A.unshift(I.semanticValue),S&&S.unshift(I.loc))}var J={symbol:y[0]};if(b){on=s?s.value:null,ZA=s?s.value.length:null;var pe=S!==null?A.concat(S):A;y[2].apply(y,XA(pe)),J.semanticValue=T,S&&(J.loc=k)}var de=Pt[Pt.length-1],xe=y[0];Pt.push(J,g1[de][xe])}else if(c==="acc"){Pt.pop();var ee=Pt.pop();return(Pt.length!==1||Pt[0]!==0||Yt.hasMoreTokens())&&(Je.options=n,GA(i)),ee.hasOwnProperty("semanticValue")?(Je.options=n,Io.onParseEnd(ee.semanticValue),ee.semanticValue):(Io.onParseEnd(),Je.options=n,!0)}}while(Yt.hasMoreTokens()||Pt.length>1)},"parse"),setTokenizer:o(function(e){return Yt=e,Io},"setTokenizer"),getTokenizer:o(function(){return Yt},"getTokenizer"),onParseBegin:o(function(e,r,n){},"onParseBegin"),onParseEnd:o(function(e){},"onParseEnd"),onShift:o(function(e){return e},"onShift")},b1=0,fd={},YA="";Io.onParseBegin=function(t,e){YA=t,b1=0,fd={};var r=t.lastIndexOf("/"),n=t.slice(r);n.includes("x")&&n.includes("u")?e.pushState("xu"):(n.includes("x")&&e.pushState("x"),n.includes("u")&&e.pushState("u"))};Io.onShift=function(t){return(t.type==="L_PAREN"||t.type==="NAMED_CAPTURE_GROUP")&&(t.value=new String(t.value),t.value.groupNumber=++b1),t};function v1(t){var e=t.match(/\d+/g).map(Number);if(Number.isFinite(e[1])&&e[1]<e[0])throw new SyntaxError("Numbers out of order in "+t+" quantifier");return e}o(v1,"getRange");function KA(t,e){if(t.kind==="control"||e.kind==="control"||!isNaN(t.codePoint)&&!isNaN(e.codePoint)&&t.codePoint>e.codePoint)throw new SyntaxError("Range "+t.value+"-"+e.value+" out of order in character class")}o(KA,"checkClassRange");var Ua=WA();function TE(t,e){var r=t[1]==="P",n=t.indexOf("="),i=t.slice(3,n!==-1?n:-1),s=void 0,u=n===-1&&Ua.isGeneralCategoryValue(i),a=n===-1&&Ua.isBinaryPropertyName(i);if(u)s=i,i="General_Category";else if(a)s=i;else{if(!Ua.isValidName(i))throw new SyntaxError("Invalid unicode property name: "+i+".");if(s=t.slice(n+1,-1),!Ua.isValidValue(i,s))throw new SyntaxError("Invalid "+i+" unicode property value: "+s+".")}return je({type:"UnicodeProperty",name:i,value:s,negative:r,shorthand:u,binary:a,canonicalName:Ua.getCanonicalName(i)||i,canonicalValue:Ua.getCanonicalValue(s)||s},e)}o(TE,"UnicodeProperty");function Tt(t,e,r){var n=void 0,i=void 0;switch(e){case"decimal":{i=Number(t.slice(1)),n=String.fromCodePoint(i);break}case"oct":{i=parseInt(t.slice(1),8),n=String.fromCodePoint(i);break}case"hex":case"unicode":{if(t.lastIndexOf("\\u")>0){var s=t.split("\\u").slice(1),u=kE(s,2),a=u[0],c=u[1];a=parseInt(a,16),c=parseInt(c,16),i=(a-55296)*1024+(c-56320)+65536,n=String.fromCodePoint(i)}else{var d=t.slice(2).replace("{","");if(i=parseInt(d,16),i>1114111)throw new SyntaxError("Bad character escape sequence: "+t);n=String.fromCodePoint(i)}break}case"meta":{switch(t){case"\\t":n=" ",i=n.codePointAt(0);break;case"\\n":n=`
|
|
7
|
+
`,i=n.codePointAt(0);break;case"\\r":n="\r",i=n.codePointAt(0);break;case"\\v":n="\v",i=n.codePointAt(0);break;case"\\f":n="\f",i=n.codePointAt(0);break;case"\\b":n="\b",i=n.codePointAt(0);case"\\0":n="\0",i=0;case".":n=".",i=NaN;break;default:i=NaN}break}case"simple":{n=t,i=n.codePointAt(0);break}}return je({type:"Char",value:t,kind:e,symbol:n,codePoint:i},r)}o(Tt,"Char");var IE="gimsuxy";function OE(t){var e=new Set,r=!0,n=!1,i=void 0;try{for(var s=t[Symbol.iterator](),u;!(r=(u=s.next()).done);r=!0){var a=u.value;if(e.has(a)||!IE.includes(a))throw new SyntaxError("Invalid flags: "+t);e.add(a)}}catch(c){n=!0,i=c}finally{try{!r&&s.return&&s.return()}finally{if(n)throw i}}return t.split("").sort().join("")}o(OE,"checkFlags");function RE(t,e){var r=Number(t.slice(1));return r>0&&r<=b1?je({type:"Backreference",kind:"number",number:r,reference:r},e):Tt(t,"decimal",e)}o(RE,"GroupRefOrDecChar");var jE=/^\\u[0-9a-fA-F]{4}/,NE=/^\\u\{[0-9a-fA-F]{1,}\}/,BE=/\\u\{[0-9a-fA-F]{1,}\}/;function JA(t,e){var r=BE.test(t),n=e==="u"||e==="xu"||e==="u_class";if(r&&!n)throw new SyntaxError('invalid group Unicode name "'+t+'", use `u` flag.');return t}o(JA,"validateUnicodeGroupName");var DE=/\\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 e3(t){return t.replace(new RegExp(DE,"g"),function(e,r,n,i,s,u,a){return r?String.fromCodePoint(parseInt(r,16),parseInt(n,16)):i?String.fromCodePoint(parseInt(i,16)):s?String.fromCodePoint(parseInt(s,16)):u?String.fromCodePoint(parseInt(u,16)):a?String.fromCodePoint(parseInt(a,16)):e})}o(e3,"decodeUnicodeGroupName");function qE(t,e){var r=t.slice(3,-1),n=e3(r);if(fd.hasOwnProperty(n))return je({type:"Backreference",kind:"name",number:fd[n],reference:n,referenceRaw:r},e);var i=null,s=null,u=null,a=null;e&&(i=e.startOffset,s=e.startLine,u=e.endLine,a=e.startColumn);var c=/^[\w$<>]/,d=void 0,h=[Tt(t.slice(1,2),"simple",i?{startLine:s,endLine:u,startColumn:a,startOffset:i,endOffset:i+=2,endColumn:a+=2}:null)];for(h[0].escaped=!0,t=t.slice(2);t.length>0;){var y=null;(y=t.match(jE))||(y=t.match(NE))?(i&&(d={startLine:s,endLine:u,startColumn:a,startOffset:i,endOffset:i+=y[0].length,endColumn:a+=y[0].length}),h.push(Tt(y[0],"unicode",d)),t=t.slice(y[0].length)):(y=t.match(c))&&(i&&(d={startLine:s,endLine:u,startColumn:a,startOffset:i,endOffset:++i,endColumn:++a}),h.push(Tt(y[0],"simple",d)),t=t.slice(1))}return h}o(qE,"NamedGroupRefOrChars");function je(t,e){return Je.options.captureLocations&&(t.loc={source:YA.slice(e.startOffset,e.endOffset),start:{line:e.startLine,column:e.startColumn,offset:e.startOffset},end:{line:e.endLine,column:e.endColumn,offset:e.endOffset}}),t}o(je,"Node");function Mp(t,e){return Je.options.captureLocations?{startOffset:t.startOffset,endOffset:e.endOffset,startLine:t.startLine,endLine:e.endLine,startColumn:t.startColumn,endColumn:e.endColumn}:null}o(Mp,"loc");function GA(t){t.type===QA&&t3(),Yt.throwUnexpectedToken(t.value,t.startLine,t.startColumn)}o(GA,"unexpectedToken");function t3(){ME("Unexpected end of input.")}o(t3,"unexpectedEndOfInput");function ME(t){throw new SyntaxError(t)}o(ME,"parseError");r3.exports=Io});var ld=K((Vte,i3)=>{"use strict";var dd=n3(),UE=dd.parse.bind(dd);dd.parse=function(t,e){return UE(""+t,e)};dd.setOptions({captureLocations:!1});i3.exports=dd});var $p=K((Lte,s3)=>{"use strict";var $E=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function VE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(VE,"_classCallCheck");var Up="expressions",o3="expression",_1=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;VE(this,t),this.node=e,this.parentPath=r,this.parent=r?r.node:null,this.property=n,this.index=i}return o(t,"NodePath"),$E(t,[{key:"_enforceProp",value:o(function(r){if(!this.node.hasOwnProperty(r))throw new Error("Node of type "+this.node.type+` doesn't have "`+r+'" collection.')},"_enforceProp")},{key:"setChild",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=void 0;return n!=null?(i||(i=Up),this._enforceProp(i),this.node[i][n]=r,s=t.getForNode(r,this,i,n)):(i||(i=o3),this._enforceProp(i),this.node[i]=r,s=t.getForNode(r,this,i,null)),s},"setChild")},{key:"appendChild",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;n||(n=Up),this._enforceProp(n);var i=this.node[n].length;return this.setChild(r,i,n)},"appendChild")},{key:"insertChildAt",value:o(function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Up;this._enforceProp(i),this.node[i].splice(n,0,r),n<=t.getTraversingIndex()&&t.updateTraversingIndex(1),this._rebuildIndex(this.node,i)},"insertChildAt")},{key:"remove",value:o(function(){if(!this.isRemoved()&&(t.registry.delete(this.node),this.node=null,!!this.parent)){if(this.index!==null){this.parent[this.property].splice(this.index,1),this.index<=t.getTraversingIndex()&&t.updateTraversingIndex(-1),this._rebuildIndex(this.parent,this.property),this.index=null,this.property=null;return}delete this.parent[this.property],this.property=null}},"remove")},{key:"_rebuildIndex",value:o(function(r,n){for(var i=t.getForNode(r),s=0;s<r[n].length;s++){var u=t.getForNode(r[n][s],i,n,s);u.index=s}},"_rebuildIndex")},{key:"isRemoved",value:o(function(){return this.node===null},"isRemoved")},{key:"replace",value:o(function(r){return t.registry.delete(this.node),this.node=r,this.parent?(this.index!==null?this.parent[this.property][this.index]=r:this.parent[this.property]=r,t.getForNode(r,this.parentPath,this.property,this.index)):null},"replace")},{key:"update",value:o(function(r){Object.assign(this.node,r)},"update")},{key:"getParent",value:o(function(){return this.parentPath},"getParent")},{key:"getChild",value:o(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.node.expressions?t.getForNode(this.node.expressions[r],this,Up,r):this.node.expression&&r==0?t.getForNode(this.node.expression,this,o3):null},"getChild")},{key:"hasEqualSource",value:o(function(r){return JSON.stringify(this.node,w1)===JSON.stringify(r.node,w1)},"hasEqualSource")},{key:"jsonEncode",value:o(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=r.format,i=r.useLoc;return JSON.stringify(this.node,i?null:w1,n)},"jsonEncode")},{key:"getPreviousSibling",value:o(function(){return!this.parent||this.index==null?null:t.getForNode(this.parent[this.property][this.index-1],t.getForNode(this.parent),this.property,this.index-1)},"getPreviousSibling")},{key:"getNextSibling",value:o(function(){return!this.parent||this.index==null?null:t.getForNode(this.parent[this.property][this.index+1],t.getForNode(this.parent),this.property,this.index+1)},"getNextSibling")}],[{key:"getForNode",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1;if(!r)return null;t.registry.has(r)||t.registry.set(r,new t(r,n,i,s==-1?null:s));var u=t.registry.get(r);return n!==null&&(u.parentPath=n,u.parent=u.parentPath.node),i!==null&&(u.property=i),s>=0&&(u.index=s),u},"getForNode")},{key:"initRegistry",value:o(function(){t.registry||(t.registry=new Map),t.registry.clear()},"initRegistry")},{key:"updateTraversingIndex",value:o(function(r){return t.traversingIndexStack[t.traversingIndexStack.length-1]+=r},"updateTraversingIndex")},{key:"getTraversingIndex",value:o(function(){return t.traversingIndexStack[t.traversingIndexStack.length-1]},"getTraversingIndex")}]),t})();_1.initRegistry();_1.traversingIndexStack=[];function w1(t,e){if(t!=="loc")return e}o(w1,"jsonSkipLoc");s3.exports=_1});var x1=K((Wte,u3)=>{"use strict";var $a=$p();function LE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.pre,n=e.post,i=e.skipProperty;function s(u,a,c,d){if(!(!u||typeof u.type!="string")){var h=void 0;if(r&&(h=r(u,a,c,d)),h!==!1){a&&a[c]&&(isNaN(d)?u=a[c]:u=a[c][d]);for(var y in u)if(u.hasOwnProperty(y)){if(i?i(y,u):y[0]==="$")continue;var b=u[y];if(Array.isArray(b)){var A=0;for($a.traversingIndexStack.push(A);A<b.length;)s(b[A],u,y,A),A=$a.updateTraversingIndex(1);$a.traversingIndexStack.pop()}else s(b,u,y)}}n&&n(u,a,c,d)}}o(s,"visit"),s(t,null)}o(LE,"astTraverse");u3.exports={traverse:o(function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{asNodes:!1};Array.isArray(r)||(r=[r]),r=r.filter(function(s){return typeof s.shouldRun!="function"?!0:s.shouldRun(e)}),$a.initRegistry(),r.forEach(function(s){typeof s.init=="function"&&s.init(e)});function i(s,u,a,c){var d=$a.getForNode(u),h=$a.getForNode(s,d,a,c);return h}o(i,"getPathFor"),LE(e,{pre:o(function(u,a,c,d){var h=void 0;n.asNodes||(h=i(u,a,c,d));var y=!0,b=!1,A=void 0;try{for(var S=r[Symbol.iterator](),D;!(y=(D=S.next()).done);y=!0){var I=D.value;if(typeof I["*"]=="function")if(h){if(!h.isRemoved()){var J=I["*"](h);if(J===!1)return!1}}else I["*"](u,a,c,d);var pe=void 0;if(typeof I[u.type]=="function"?pe=I[u.type]:typeof I[u.type]=="object"&&typeof I[u.type].pre=="function"&&(pe=I[u.type].pre),pe)if(h){if(!h.isRemoved()){var de=pe.call(I,h);if(de===!1)return!1}}else pe.call(I,u,a,c,d)}}catch(xe){b=!0,A=xe}finally{try{!y&&S.return&&S.return()}finally{if(b)throw A}}},"pre"),post:o(function(u,a,c,d){if(u){var h=void 0;n.asNodes||(h=i(u,a,c,d));var y=!0,b=!1,A=void 0;try{for(var S=r[Symbol.iterator](),D;!(y=(D=S.next()).done);y=!0){var I=D.value,J=void 0;if(typeof I[u.type]=="object"&&typeof I[u.type].post=="function"&&(J=I[u.type].post),J)if(h){if(!h.isRemoved()){var pe=J.call(I,h);if(pe===!1)return!1}}else J.call(I,u,a,c,d)}}catch(de){b=!0,A=de}finally{try{!y&&S.return&&S.return()}finally{if(b)throw A}}}},"post"),skipProperty:o(function(u){return u==="loc"},"skipProperty")})},"traverse")}});var Vp=K((zte,f3)=>{"use strict";var HE=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function WE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(WE,"_classCallCheck");var a3=p1(),FE=ld(),zE=x1(),c3=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;WE(this,t),this._ast=e,this._source=null,this._string=null,this._regexp=null,this._extra=r}return o(t,"TransformResult"),HE(t,[{key:"getAST",value:o(function(){return this._ast},"getAST")},{key:"setExtra",value:o(function(r){this._extra=r},"setExtra")},{key:"getExtra",value:o(function(){return this._extra},"getExtra")},{key:"toRegExp",value:o(function(){return this._regexp||(this._regexp=new RegExp(this.getSource(),this._ast.flags)),this._regexp},"toRegExp")},{key:"getSource",value:o(function(){return this._source||(this._source=a3.generate(this._ast.body)),this._source},"getSource")},{key:"getFlags",value:o(function(){return this._ast.flags},"getFlags")},{key:"toString",value:o(function(){return this._string||(this._string=a3.generate(this._ast)),this._string},"toString")}]),t})();f3.exports={TransformResult:c3,transform:o(function(e,r){var n=e;return e instanceof RegExp&&(e=""+e),typeof e=="string"&&(n=FE.parse(e,{captureLocations:!0})),zE.traverse(n,r),new c3(n)},"transform")}});var l3=K((Jte,d3)=>{"use strict";var Lp=UA(),KE=Vp();d3.exports={transform:o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=r.length>0?r:Object.keys(Lp),i=void 0,s={};return n.forEach(function(u){if(!Lp.hasOwnProperty(u))throw new Error("Unknown compat-transform: "+u+". Available transforms are: "+Object.keys(Lp).join(", "));var a=Lp[u];i=KE.transform(e,a),e=i.getAST(),typeof a.getExtra=="function"&&(s[u]=a.getExtra())}),i.setExtra(s),i},"transform")}});var h3=K((Xte,p3)=>{"use strict";p3.exports=o(function t(e){if(e===null||typeof e!="object")return e;var r=void 0;Array.isArray(e)?r=[]:r={};for(var n in e)r[n]=t(e[n]);return r},"clone")});var m3=K((Qte,y3)=>{"use strict";y3.exports={shouldRun:o(function(e){return e.flags.includes("u")},"shouldRun"),Char:o(function(e){var r=e.node;r.kind!=="unicode"||!r.isSurrogatePair||isNaN(r.codePoint)||(r.value="\\u{"+r.codePoint.toString(16)+"}",delete r.isSurrogatePair)},"Char")}});var S3=K((ere,A3)=>{"use strict";var g3="A".codePointAt(0),v3="Z".codePointAt(0),b3="a".codePointAt(0),w3="z".codePointAt(0),_3="0".codePointAt(0),x3="9".codePointAt(0);A3.exports={Char:o(function(e){var r=e.node,n=e.parent;if(!(isNaN(r.codePoint)||r.kind==="simple")&&!(n.type==="ClassRange"&&!JE(n))&&GE(r.codePoint)){var i=String.fromCodePoint(r.codePoint),s={type:"Char",kind:"simple",value:i,symbol:i,codePoint:r.codePoint};XE(i,n.type)&&(s.escaped=!0),e.replace(s)}},"Char")};function JE(t){var e=t.from,r=t.to;return e.codePoint>=_3&&e.codePoint<=x3&&r.codePoint>=_3&&r.codePoint<=x3||e.codePoint>=g3&&e.codePoint<=v3&&r.codePoint>=g3&&r.codePoint<=v3||e.codePoint>=b3&&e.codePoint<=w3&&r.codePoint>=b3&&r.codePoint<=w3}o(JE,"isSimpleRange");function GE(t){return t>=32&&t<=126}o(GE,"isPrintableASCIIChar");function XE(t,e){return e==="ClassRange"||e==="CharacterClass"?/[\]\\^-]/.test(t):/[*[()+?^$./\\|{}]/.test(t)}o(XE,"needsEscape")});var P3=K((rre,E3)=>{"use strict";var k3="A".codePointAt(0),C3="Z".codePointAt(0);E3.exports={_AZClassRanges:null,_hasUFlag:!1,init:o(function(e){this._AZClassRanges=new Set,this._hasUFlag=e.flags.includes("u")},"init"),shouldRun:o(function(e){return e.flags.includes("i")},"shouldRun"),Char:o(function(e){var r=e.node,n=e.parent;if(!isNaN(r.codePoint)&&!(!this._hasUFlag&&r.codePoint>=4096)){if(n.type==="ClassRange"){if(!this._AZClassRanges.has(n)&&!ZE(n))return;this._AZClassRanges.add(n)}var i=r.symbol.toLowerCase();i!==r.symbol&&(r.value=QE(i,r),r.symbol=i,r.codePoint=i.codePointAt(0))}},"Char")};function ZE(t){var e=t.from,r=t.to;return e.codePoint>=k3&&e.codePoint<=C3&&r.codePoint>=k3&&r.codePoint<=C3}o(ZE,"isAZClassRange");function QE(t,e){var r=t.codePointAt(0);if(e.kind==="decimal")return"\\"+r;if(e.kind==="oct")return"\\0"+r.toString(8);if(e.kind==="hex")return"\\x"+r.toString(16);if(e.kind==="unicode")if(e.isSurrogatePair){var n=YE(r),i=n.lead,s=n.trail;return"\\u"+"0".repeat(4-i.length)+i+"\\u"+"0".repeat(4-s.length)+s}else{if(e.value.includes("{"))return"\\u{"+r.toString(16)+"}";var u=r.toString(16);return"\\u"+"0".repeat(4-u.length)+u}return t}o(QE,"displaySymbolAsValue");function YE(t){var e=Math.floor((t-65536)/1024)+55296,r=(t-65536)%1024+56320;return{lead:e.toString(16),trail:r.toString(16)}}o(YE,"getSurrogatePairFromCodePoint")});var I3=K((ire,T3)=>{"use strict";T3.exports={CharacterClass:o(function(e){for(var r=e.node,n={},i=0;i<r.expressions.length;i++){var s=e.getChild(i),u=s.jsonEncode();n.hasOwnProperty(u)&&(s.remove(),i--),n[u]=!0}},"CharacterClass")}});var Hp=K((sre,R3)=>{"use strict";function e6(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(e6,"_toConsumableArray");function O3(t){if(t.type!=="Disjunction")throw new TypeError('Expected "Disjunction" node, got "'+t.type+'"');var e=[];return t.left&&t.left.type==="Disjunction"?e.push.apply(e,e6(O3(t.left)).concat([t.right])):e.push(t.left,t.right),e}o(O3,"disjunctionToList");function t6(t){return t.reduce(function(e,r){return{type:"Disjunction",left:e,right:r}})}o(t6,"listToDisjunction");function r6(t){t.kind==="*"?t.kind="+":t.kind==="+"?(t.kind="Range",t.from=2,delete t.to):t.kind==="?"?(t.kind="Range",t.from=1,t.to=2):t.kind==="Range"&&(t.from+=1,t.to&&(t.to+=1))}o(r6,"increaseQuantifierByOne");R3.exports={disjunctionToList:O3,listToDisjunction:t6,increaseQuantifierByOne:r6}});var B3=K((are,N3)=>{"use strict";var n6=Hp(),i6=n6.increaseQuantifierByOne;N3.exports={Repetition:o(function(e){var r=e.node,n=e.parent;if(!(n.type!=="Alternative"||!e.index)){var i=e.getPreviousSibling();if(i)if(i.node.type==="Repetition"){if(!i.getChild().hasEqualSource(e.getChild()))return;var s=j3(i.node.quantifier),u=s.from,a=s.to,c=j3(r.quantifier),d=c.from,h=c.to;if(i.node.quantifier.greedy!==r.quantifier.greedy&&!Wp(i.node.quantifier)&&!Wp(r.quantifier))return;r.quantifier.kind="Range",r.quantifier.from=u+d,a&&h?r.quantifier.to=a+h:delete r.quantifier.to,(Wp(i.node.quantifier)||Wp(r.quantifier))&&(r.quantifier.greedy=!0),i.remove()}else{if(!i.hasEqualSource(e.getChild()))return;i6(r.quantifier),i.remove()}}},"Repetition")};function Wp(t){return t.greedy&&(t.kind==="+"||t.kind==="*"||t.kind==="Range"&&!t.to)}o(Wp,"isGreedyOpenRange");function j3(t){var e=void 0,r=void 0;return t.kind==="*"?e=0:t.kind==="+"?e=1:t.kind==="?"?(e=0,r=1):(e=t.from,t.to&&(r=t.to)),{from:e,to:r}}o(j3,"extractFromTo")});var q3=K((fre,D3)=>{"use strict";D3.exports={Quantifier:o(function(e){var r=e.node;r.kind==="Range"&&(o6(e),s6(e),u6(e))},"Quantifier")};function o6(t){var e=t.node;e.from!==0||e.to||(e.kind="*",delete e.from)}o(o6,"rewriteOpenZero");function s6(t){var e=t.node;e.from!==1||e.to||(e.kind="+",delete e.from)}o(s6,"rewriteOpenOne");function u6(t){var e=t.node;e.from!==1||e.to!==1||t.parentPath.replace(t.parentPath.node.expression)}o(u6,"rewriteExactOne")});var U3=K((lre,M3)=>{"use strict";M3.exports={ClassRange:o(function(e){var r=e.node;r.from.codePoint===r.to.codePoint?e.replace(r.from):r.from.codePoint===r.to.codePoint-1&&(e.getParent().insertChildAt(r.to,e.index+1),e.replace(r.from))},"ClassRange")}});var H3=K((hre,L3)=>{"use strict";function $3(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o($3,"_toConsumableArray");L3.exports={_hasIFlag:!1,_hasUFlag:!1,init:o(function(e){this._hasIFlag=e.flags.includes("i"),this._hasUFlag=e.flags.includes("u")},"init"),CharacterClass:o(function(e){a6(e),c6(e,this._hasIFlag,this._hasUFlag),f6(e)},"CharacterClass")};function a6(t){var e=t.node;e.expressions.forEach(function(r,n){d6(r)&&t.getChild(n).replace({type:"Char",value:"\\d",kind:"meta"})})}o(a6,"rewriteNumberRanges");function c6(t,e,r){var n=t.node,i=null,s=null,u=null,a=null,c=null,d=null;n.expressions.forEach(function(h,y){S1(h,"\\d")?i=t.getChild(y):l6(h)?s=t.getChild(y):p6(h)?u=t.getChild(y):h6(h)?a=t.getChild(y):e&&r&&pd(h,383)?c=t.getChild(y):e&&r&&pd(h,8490)&&(d=t.getChild(y))}),i&&(s&&u||e&&(s||u))&&a&&(!r||!e||c&&d)&&(i.replace({type:"Char",value:"\\w",kind:"meta"}),s&&s.remove(),u&&u.remove(),a.remove(),c&&c.remove(),d&&d.remove())}o(c6,"rewriteWordRanges");var A1=[function(t){return V3(t," ")}].concat($3(["\\f","\\n","\\r","\\t","\\v"].map(function(t){return function(e){return S1(e,t)}})),$3([160,5760,8232,8233,8239,8287,12288,65279].map(function(t){return function(e){return pd(e,t)}})),[function(t){return t.type==="ClassRange"&&pd(t.from,8192)&&pd(t.to,8202)}]);function f6(t){var e=t.node;if(!(e.expressions.length<A1.length||!A1.every(function(n){return e.expressions.some(function(i){return n(i)})}))){var r=e.expressions.find(function(n){return S1(n,"\\n")});r.value="\\s",r.symbol=void 0,r.codePoint=NaN,e.expressions.map(function(n,i){return A1.some(function(s){return s(n)})?t.getChild(i):void 0}).filter(Boolean).forEach(function(n){return n.remove()})}}o(f6,"rewriteWhitespaceRanges");function d6(t){return t.type==="ClassRange"&&t.from.value==="0"&&t.to.value==="9"}o(d6,"isFullNumberRange");function V3(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"simple";return t.type==="Char"&&t.value===e&&t.kind===r}o(V3,"isChar");function S1(t,e){return V3(t,e,"meta")}o(S1,"isMetaChar");function l6(t){return t.type==="ClassRange"&&t.from.value==="a"&&t.to.value==="z"}o(l6,"isLowerCaseRange");function p6(t){return t.type==="ClassRange"&&t.from.value==="A"&&t.to.value==="Z"}o(p6,"isUpperCaseRange");function h6(t){return t.type==="Char"&&t.value==="_"&&t.kind==="simple"}o(h6,"isUnderscore");function pd(t,e){return t.type==="Char"&&t.kind==="unicode"&&t.codePoint===e}o(pd,"isCodePoint")});var F3=K((mre,W3)=>{"use strict";W3.exports={CharacterClass:o(function(e){var r=e.node;if(!(r.expressions.length!==1||!v6(e)||!y6(r.expressions[0]))){var n=r.expressions[0],i=n.value,s=n.kind,u=n.escaped;if(r.negative){if(!m6(i))return;i=g6(i)}e.replace({type:"Char",value:i,kind:s,escaped:u||b6(i)})}},"CharacterClass")};function y6(t){return t.type==="Char"&&t.value!=="\\b"}o(y6,"isAppropriateChar");function m6(t){return/^\\[dwsDWS]$/.test(t)}o(m6,"isMeta");function g6(t){return/[dws]/.test(t)?t.toUpperCase():t.toLowerCase()}o(g6,"getInverseMeta");function v6(t){var e=t.parent,r=t.index;if(e.type!=="Alternative")return!0;var n=e.expressions[r-1];return n==null?!0:!(n.type==="Backreference"&&n.kind==="number"||n.type==="Char"&&n.kind==="decimal")}o(v6,"hasAppropriateSiblings");function b6(t){return/[*[()+?$./{}|]/.test(t)}o(b6,"shouldEscape")});var K3=K((vre,z3)=>{"use strict";z3.exports={_hasXFlag:!1,init:o(function(e){this._hasXFlag=e.flags.includes("x")},"init"),Char:o(function(e){var r=e.node;r.escaped&&w6(e,this._hasXFlag)&&delete r.escaped},"Char")};function w6(t,e){var r=t.node.value,n=t.index,i=t.parent;return i.type!=="CharacterClass"&&i.type!=="ClassRange"?!x6(r,n,i,e):!_6(r,n,i)}o(w6,"shouldUnescape");function _6(t,e,r){return t==="^"?e===0&&!r.negative:t==="-"?!0:/[\]\\]/.test(t)}o(_6,"preservesInCharClass");function x6(t,e,r,n){return t==="{"?A6(e,r):t==="}"?S6(e,r):n&&/[ #]/.test(t)?!0:/[*[()+?^$./\\|]/.test(t)}o(x6,"preservesEscape");function Fp(t,e,r){for(var n=t,i=(r?n>=0:n<e.expressions.length)&&e.expressions[n];i&&i.type==="Char"&&i.kind==="simple"&&!i.escaped&&/\d/.test(i.value);)r?n--:n++,i=(r?n>=0:n<e.expressions.length)&&e.expressions[n];return Math.abs(t-n)}o(Fp,"consumeNumbers");function Va(t,e){return t&&t.type==="Char"&&t.kind==="simple"&&!t.escaped&&t.value===e}o(Va,"isSimpleChar");function A6(t,e){if(t==null)return!1;var r=Fp(t+1,e),n=t+r+1,i=n<e.expressions.length&&e.expressions[n];if(r){if(Va(i,"}"))return!0;if(Va(i,","))return r=Fp(n+1,e),n=n+r+1,i=n<e.expressions.length&&e.expressions[n],Va(i,"}")}return!1}o(A6,"preservesOpeningCurlyBraceEscape");function S6(t,e){if(t==null)return!1;var r=Fp(t-1,e,!0),n=t-r-1,i=n>=0&&e.expressions[n];return r&&Va(i,"{")?!0:Va(i,",")?(r=Fp(n-1,e,!0),n=n-r-1,i=n<e.expressions.length&&e.expressions[n],r&&Va(i,"{")):!1}o(S6,"preservesClosingCurlyBraceEscape")});var Z3=K((wre,X3)=>{"use strict";X3.exports={_hasIUFlags:!1,init:o(function(e){this._hasIUFlags=e.flags.includes("i")&&e.flags.includes("u")},"init"),CharacterClass:o(function(e){var r=e.node,n=r.expressions,i=[];n.forEach(function(c){Fn(c)&&i.push(c.value)}),n.sort(k6);for(var s=0;s<n.length;s++){var u=n[s];if(C6(u,i,this._hasIUFlags)||E6(u,n[s-1])||P6(u,n[s+1]))n.splice(s,1),s--;else{var a=T6(u,s,n);n.splice(s-a+1,a),s-=a}}},"CharacterClass")};function k6(t,e){var r=zp(t),n=zp(e);if(r===n){if(t.type==="ClassRange"&&e.type!=="ClassRange")return-1;if(e.type==="ClassRange"&&t.type!=="ClassRange")return 1;if(t.type==="ClassRange"&&e.type==="ClassRange")return zp(t.to)-zp(e.to);if(Fn(t)&&Fn(e)||J3(t)&&J3(e))return t.value<e.value?-1:1}return r-n}o(k6,"sortCharClass");function zp(t){return t.type==="Char"?t.value==="-"||t.kind==="control"?1/0:t.kind==="meta"&&isNaN(t.codePoint)?-1:t.codePoint:t.from.codePoint}o(zp,"getSortValue");function Fn(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.type==="Char"&&t.kind==="meta"&&(e?t.value===e:/^\\[dws]$/i.test(t.value))}o(Fn,"isMeta");function J3(t){return t.type==="Char"&&t.kind==="control"}o(J3,"isControl");function C6(t,e,r){for(var n=0;n<e.length;n++)if(k1(t,e[n],r))return!0;return!1}o(C6,"fitsInMetas");function k1(t,e,r){return t.type==="ClassRange"?k1(t.from,e,r)&&k1(t.to,e,r):e==="\\S"&&(Fn(t,"\\w")||Fn(t,"\\d"))||e==="\\D"&&(Fn(t,"\\W")||Fn(t,"\\s"))||e==="\\w"&&Fn(t,"\\d")||e==="\\W"&&Fn(t,"\\s")?!0:t.type!=="Char"||isNaN(t.codePoint)?!1:e==="\\s"?G3(t):e==="\\S"?!G3(t):e==="\\d"?C1(t):e==="\\D"?!C1(t):e==="\\w"?E1(t,r):e==="\\W"?!E1(t,r):!1}o(k1,"fitsInMeta");function G3(t){return t.codePoint===9||t.codePoint===10||t.codePoint===11||t.codePoint===12||t.codePoint===13||t.codePoint===32||t.codePoint===160||t.codePoint===5760||t.codePoint>=8192&&t.codePoint<=8202||t.codePoint===8232||t.codePoint===8233||t.codePoint===8239||t.codePoint===8287||t.codePoint===12288||t.codePoint===65279}o(G3,"fitsInMetaS");function C1(t){return t.codePoint>=48&&t.codePoint<=57}o(C1,"fitsInMetaD");function E1(t,e){return C1(t)||t.codePoint>=65&&t.codePoint<=90||t.codePoint>=97&&t.codePoint<=122||t.value==="_"||e&&(t.codePoint===383||t.codePoint===8490)}o(E1,"fitsInMetaW");function E6(t,e){if(e&&e.type==="ClassRange"){if(P1(t,e))return!0;if(Kp(t)&&e.to.codePoint===t.codePoint-1)return e.to=t,!0;if(t.type==="ClassRange"&&t.from.codePoint<=e.to.codePoint+1&&t.to.codePoint>=e.from.codePoint-1)return t.from.codePoint<e.from.codePoint&&(e.from=t.from),t.to.codePoint>e.to.codePoint&&(e.to=t.to),!0}return!1}o(E6,"combinesWithPrecedingClassRange");function P6(t,e){return e&&e.type==="ClassRange"&&Kp(t)&&e.from.codePoint===t.codePoint+1?(e.from=t,!0):!1}o(P6,"combinesWithFollowingClassRange");function P1(t,e){return t.type==="Char"&&isNaN(t.codePoint)?!1:t.type==="ClassRange"?P1(t.from,e)&&P1(t.to,e):t.codePoint>=e.from.codePoint&&t.codePoint<=e.to.codePoint}o(P1,"fitsInClassRange");function T6(t,e,r){if(!Kp(t))return 0;for(var n=0;e>0;){var i=r[e],s=r[e-1];if(Kp(s)&&s.codePoint===i.codePoint-1)n++,e--;else break}return n>1?(r[e]={type:"ClassRange",from:r[e],to:t},n):0}o(T6,"charCombinesWithPrecedingChars");function Kp(t){return t&&t.type==="Char"&&!isNaN(t.codePoint)&&(E1(t,!1)||t.kind==="unicode"||t.kind==="hex"||t.kind==="oct"||t.kind==="decimal")}o(Kp,"isMetaWCharOrCode")});var eS=K((xre,Y3)=>{"use strict";var I6=$p(),Q3=Hp(),O6=Q3.disjunctionToList,R6=Q3.listToDisjunction;Y3.exports={Disjunction:o(function(e){var r=e.node,n={},i=O6(r).filter(function(s){var u=s?I6.getForNode(s).jsonEncode():"null";return n.hasOwnProperty(u)?!1:(n[u]=s,!0)});e.replace(R6(i))},"Disjunction")}});var nS=K((Sre,rS)=>{"use strict";rS.exports={Disjunction:o(function(e){var r=e.node,n=e.parent;if(tS[n.type]){var i=new Map;if(!(!Jp(r,i)||!i.size)){var s={type:"CharacterClass",expressions:Array.from(i.keys()).sort().map(function(u){return i.get(u)})};tS[n.type](e.getParent(),s)}}},"Disjunction")};var tS={RegExp:o(function(e,r){var n=e.node;n.body=r},"RegExp"),Group:o(function(e,r){var n=e.node;n.capturing?n.expression=r:e.replace(r)},"Group")};function Jp(t,e){if(!t)return!1;var r=t.type;if(r==="Disjunction"){var n=t.left,i=t.right;return Jp(n,e)&&Jp(i,e)}else if(r==="Char"){if(t.kind==="meta"&&t.symbol===".")return!1;var s=t.value;return e.set(s,t),!0}else if(r==="CharacterClass"&&!t.negative)return t.expressions.every(function(u){return Jp(u,e)});return!1}o(Jp,"shouldProcess")});var oS=K((Cre,iS)=>{"use strict";iS.exports={Group:o(function(e){var r=e.node,n=e.parent,i=e.getChild();r.capturing||i||(n.type==="Repetition"?e.getParent().replace(r):n.type!=="RegExp"&&e.remove())},"Group")}});var uS=K((Pre,sS)=>{"use strict";function T1(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(T1,"_toConsumableArray");sS.exports={Group:o(function(e){var r=e.node,n=e.parent,i=e.getChild();if(!(r.capturing||!i)&&j6(e)&&!(i.node.type==="Disjunction"&&n.type!=="RegExp")&&!(n.type==="Repetition"&&i.node.type!=="Char"&&i.node.type!=="CharacterClass"))if(i.node.type==="Alternative"){var s=e.getParent();s.node.type==="Alternative"&&s.replace({type:"Alternative",expressions:[].concat(T1(n.expressions.slice(0,e.index)),T1(i.node.expressions),T1(n.expressions.slice(e.index+1)))})}else e.replace(i.node)},"Group")};function j6(t){var e=t.parent,r=t.index;if(e.type!=="Alternative")return!0;var n=e.expressions[r-1];return n==null?!0:!(n.type==="Backreference"&&n.kind==="number"||n.type==="Char"&&n.kind==="decimal")}o(j6,"hasAppropriateSiblings")});var fS=K((Ire,cS)=>{"use strict";function Gp(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(Gp,"_toConsumableArray");var Xp=$p(),N6=Hp(),aS=N6.increaseQuantifierByOne;cS.exports={Alternative:o(function(e){for(var r=e.node,n=1;n<r.expressions.length;){var i=e.getChild(n);if(n=Math.max(1,B6(e,i,n)),n>=r.expressions.length||(i=e.getChild(n),n=Math.max(1,D6(e,i,n)),n>=r.expressions.length))break;i=e.getChild(n),n=Math.max(1,q6(e,i,n)),n++}},"Alternative")};function B6(t,e,r){for(var n=t.node,i=Math.ceil(r/2),s=0;s<i;){var u=r-2*s-1,a=void 0,c=void 0;if(s===0?(a=e,c=t.getChild(u)):(a=Xp.getForNode({type:"Alternative",expressions:[].concat(Gp(n.expressions.slice(r-s,r)),[e.node])}),c=Xp.getForNode({type:"Alternative",expressions:[].concat(Gp(n.expressions.slice(u,r-s)))})),a.hasEqualSource(c)){for(var d=0;d<2*s+1;d++)t.getChild(u).remove();return e.replace({type:"Repetition",expression:s===0&&a.node.type!=="Repetition"?a.node:{type:"Group",capturing:!1,expression:a.node},quantifier:{type:"Quantifier",kind:"Range",from:2,to:2,greedy:!0}}),u}s++}return r}o(B6,"combineRepeatingPatternLeft");function D6(t,e,r){for(var n=t.node,i=0;i<r;){var s=t.getChild(i);if(s.node.type==="Repetition"&&s.node.quantifier.greedy){var u=s.getChild(),a=void 0;if(u.node.type==="Group"&&!u.node.capturing&&(u=u.getChild()),i+1===r?(a=e,a.node.type==="Group"&&!a.node.capturing&&(a=a.getChild())):a=Xp.getForNode({type:"Alternative",expressions:[].concat(Gp(n.expressions.slice(i+1,r+1)))}),u.hasEqualSource(a)){for(var c=i;c<r;c++)t.getChild(i+1).remove();return aS(s.node.quantifier),i}}i++}return r}o(D6,"combineWithPreviousRepetition");function q6(t,e,r){var n=t.node;if(e.node.type==="Repetition"&&e.node.quantifier.greedy){var i=e.getChild(),s=void 0;i.node.type==="Group"&&!i.node.capturing&&(i=i.getChild());var u=void 0;if(i.node.type==="Alternative"?(u=i.node.expressions.length,s=Xp.getForNode({type:"Alternative",expressions:[].concat(Gp(n.expressions.slice(r-u,r)))})):(u=1,s=t.getChild(r-1),s.node.type==="Group"&&!s.node.capturing&&(s=s.getChild())),s.hasEqualSource(i)){for(var a=r-u;a<r;a++)t.getChild(r-u).remove();return aS(e.node.quantifier),r-u}}return r}o(q6,"combineRepetitionWithPrevious")});var lS=K((Rre,dS)=>{"use strict";dS.exports=new Map([["charSurrogatePairToSingleUnicode",m3()],["charCodeToSimpleChar",S3()],["charCaseInsensitiveLowerCaseTransform",P3()],["charClassRemoveDuplicates",I3()],["quantifiersMerge",B3()],["quantifierRangeToSymbol",q3()],["charClassClassrangesToChars",U3()],["charClassToMeta",H3()],["charClassToSingleChar",F3()],["charEscapeUnescape",K3()],["charClassClassrangesMerge",Z3()],["disjunctionRemoveDuplicates",eS()],["groupSingleCharsToCharClass",nS()],["removeEmptyGroup",oS()],["ungroup",uS()],["combineRepeatingPatterns",fS()]])});var mS=K((jre,yS)=>{"use strict";var pS=h3(),M6=ld(),hS=Vp(),Zp=lS();yS.exports={optimize:o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.whitelist,i=n===void 0?[]:n,s=r.blacklist,u=s===void 0?[]:s,a=i.length>0?i:Array.from(Zp.keys()),c=a.filter(function(b){return!u.includes(b)}),d=e;e instanceof RegExp&&(e=""+e),typeof e=="string"&&(d=M6.parse(e));var h=new hS.TransformResult(d),y=void 0;do y=h.toString(),d=pS(h.getAST()),c.forEach(function(b){if(!Zp.has(b))throw new Error("Unknown optimization-transform: "+b+". Available transforms are: "+Array.from(Zp.keys()).join(", "));var A=Zp.get(b),S=hS.transform(d,A);S.toString()!==h.toString()&&(S.toString().length<=h.toString().length?h=S:d=pS(h.getAST()))});while(h.toString()!==y);return h},"optimize")}});var hd=K((Bre,vS)=>{"use strict";var gS="\u03B5",U6=gS+"*";vS.exports={EPSILON:gS,EPSILON_CLOSURE:U6}});var I1=K((Dre,_S)=>{"use strict";var $6=(function(){function t(e,r){var n=[],i=!0,s=!1,u=void 0;try{for(var a=e[Symbol.iterator](),c;!(i=(c=a.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(d){s=!0,u=d}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return n}return o(t,"sliceIterator"),function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),V6=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function L6(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(L6,"_toConsumableArray");function H6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(H6,"_classCallCheck");var wS=hd(),W6=wS.EPSILON,bS=wS.EPSILON_CLOSURE,F6=(function(){function t(e,r){H6(this,t),this.in=e,this.out=r}return o(t,"NFA"),V6(t,[{key:"matches",value:o(function(r){return this.in.matches(r)},"matches")},{key:"getAlphabet",value:o(function(){if(!this._alphabet){this._alphabet=new Set;var r=this.getTransitionTable();for(var n in r){var i=r[n];for(var s in i)s!==bS&&this._alphabet.add(s)}}return this._alphabet},"getAlphabet")},{key:"getAcceptingStates",value:o(function(){return this._acceptingStates||this.getTransitionTable(),this._acceptingStates},"getAcceptingStates")},{key:"getAcceptingStateNumbers",value:o(function(){if(!this._acceptingStateNumbers){this._acceptingStateNumbers=new Set;var r=!0,n=!1,i=void 0;try{for(var s=this.getAcceptingStates()[Symbol.iterator](),u;!(r=(u=s.next()).done);r=!0){var a=u.value;this._acceptingStateNumbers.add(a.number)}}catch(c){n=!0,i=c}finally{try{!r&&s.return&&s.return()}finally{if(n)throw i}}}return this._acceptingStateNumbers},"getAcceptingStateNumbers")},{key:"getTransitionTable",value:o(function(){var r=this;if(!this._transitionTable){this._transitionTable={},this._acceptingStates=new Set;var n=new Set,i=new Set,s=o(function u(a){if(!n.has(a)){n.add(a),a.number=n.size,r._transitionTable[a.number]={},a.accepting&&r._acceptingStates.add(a);var c=a.getTransitions(),d=!0,h=!1,y=void 0;try{for(var b=c[Symbol.iterator](),A;!(d=(A=b.next()).done);d=!0){var S=A.value,D=$6(S,2),I=D[0],J=D[1],pe=[];i.add(I);var de=!0,xe=!1,ee=void 0;try{for(var ve=J[Symbol.iterator](),ce;!(de=(ce=ve.next()).done);de=!0){var Ve=ce.value;u(Ve),pe.push(Ve.number)}}catch(It){xe=!0,ee=It}finally{try{!de&&ve.return&&ve.return()}finally{if(xe)throw ee}}r._transitionTable[a.number][I]=pe}}catch(It){h=!0,y=It}finally{try{!d&&b.return&&b.return()}finally{if(h)throw y}}}},"visitState");s(this.in),n.forEach(function(u){delete r._transitionTable[u.number][W6],r._transitionTable[u.number][bS]=[].concat(L6(u.getEpsilonClosure())).map(function(a){return a.number})})}return this._transitionTable},"getTransitionTable")}]),t})();_S.exports=F6});var AS=K((Mre,xS)=>{"use strict";var z6=(function(){function t(e,r){var n=[],i=!0,s=!1,u=void 0;try{for(var a=e[Symbol.iterator](),c;!(i=(c=a.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(d){s=!0,u=d}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return n}return o(t,"sliceIterator"),function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();function K6(t){return Array.isArray(t)?t:Array.from(t)}o(K6,"_toArray");function O1(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(O1,"_toConsumableArray");var zn=null;function J6(t){var e=t.getTransitionTable(),r=Object.keys(e),n=t.getAlphabet(),i=t.getAcceptingStateNumbers();zn={};var s=new Set;r.forEach(function(Te){Te=Number(Te);var V=i.has(Te);V?zn[Te]=i:(s.add(Te),zn[Te]=s)});var u=[[s,i].filter(function(Te){return Te.size>0})],a=void 0,c=void 0;a=u[u.length-1],c=u[u.length-2];for(var d=o(function(){var V={},vt=!0,wr=!1,he=void 0;try{for(var _r=a[Symbol.iterator](),Ur;!(vt=(Ur=_r.next()).done);vt=!0){var un=Ur.value,xr={},bt=K6(un),Ka=bt[0],Qn=bt.slice(1);xr[Ka]=new Set([Ka]);var Oo=!0,bd=!1,Ro=void 0;try{e:for(var jo=Qn[Symbol.iterator](),Ja;!(Oo=(Ja=jo.next()).done);Oo=!0){var Yn=Ja.value,No=!0,Ga=!1,Bo=void 0;try{for(var Xa=Object.keys(xr)[Symbol.iterator](),wd;!(No=(wd=Xa.next()).done);No=!0){var Za=wd.value;if(X6(Yn,Za,e,n)){xr[Za].add(Yn),xr[Yn]=xr[Za];continue e}}}catch(zt){Ga=!0,Bo=zt}finally{try{!No&&Xa.return&&Xa.return()}finally{if(Ga)throw Bo}}xr[Yn]=new Set([Yn])}}catch(zt){bd=!0,Ro=zt}finally{try{!Oo&&jo.return&&jo.return()}finally{if(bd)throw Ro}}Object.assign(V,xr)}}catch(zt){wr=!0,he=zt}finally{try{!vt&&_r.return&&_r.return()}finally{if(wr)throw he}}zn=V;var fh=new Set(Object.keys(V).map(function(zt){return V[zt]}));u.push([].concat(O1(fh))),a=u[u.length-1],c=u[u.length-2]},"_loop");!G6(a,c);)d();var h=new Map,y=1;a.forEach(function(Te){return h.set(Te,y++)});var b={},A=new Set,S=o(function(V,vt){var wr=!0,he=!1,_r=void 0;try{for(var Ur=V[Symbol.iterator](),un;!(wr=(un=Ur.next()).done);wr=!0){var xr=un.value;i.has(xr)&&A.add(vt)}}catch(bt){he=!0,_r=bt}finally{try{!wr&&Ur.return&&Ur.return()}finally{if(he)throw _r}}},"updateAcceptingStates"),D=!0,I=!1,J=void 0;try{for(var pe=h.entries()[Symbol.iterator](),de;!(D=(de=pe.next()).done);D=!0){var xe=de.value,ee=z6(xe,2),ve=ee[0],ce=ee[1];b[ce]={};var Ve=!0,It=!1,mt=void 0;try{for(var Ft=n[Symbol.iterator](),Dr;!(Ve=(Dr=Ft.next()).done);Ve=!0){var sn=Dr.value;S(ve,ce);var gt=void 0,qr=!0,Xn=!1,Mi=void 0;try{for(var Mr=ve[Symbol.iterator](),Zn;!(qr=(Zn=Mr.next()).done);qr=!0){var br=Zn.value;if(gt=e[br][sn],gt)break}}catch(Te){Xn=!0,Mi=Te}finally{try{!qr&&Mr.return&&Mr.return()}finally{if(Xn)throw Mi}}gt&&(b[ce][sn]=h.get(zn[gt]))}}catch(Te){It=!0,mt=Te}finally{try{!Ve&&Ft.return&&Ft.return()}finally{if(It)throw mt}}}}catch(Te){I=!0,J=Te}finally{try{!D&&pe.return&&pe.return()}finally{if(I)throw J}}return t.setTransitionTable(b),t.setAcceptingStateNumbers(A),t}o(J6,"minimize");function G6(t,e){if(!e||t.length!==e.length)return!1;for(var r=0;r<t.length;r++){var n=t[r],i=e[r];if(n.size!==i.size||[].concat(O1(n)).sort().join(",")!==[].concat(O1(i)).sort().join(","))return!1}return!0}o(G6,"sameRow");function X6(t,e,r,n){var i=!0,s=!1,u=void 0;try{for(var a=n[Symbol.iterator](),c;!(i=(c=a.next()).done);i=!0){var d=c.value;if(!Z6(t,e,r,d))return!1}}catch(h){s=!0,u=h}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return!0}o(X6,"areEquivalent");function Z6(t,e,r,n){if(!zn[t]||!zn[e])return!1;var i=r[t][n],s=r[e][n];return!i&&!s?!0:zn[t].has(i)&&zn[e].has(s)}o(Z6,"goToSameSet");xS.exports={minimize:J6}});var ES=K(($re,CS)=>{"use strict";var Q6=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function SS(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(SS,"_toConsumableArray");function Y6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(Y6,"_classCallCheck");var eP=AS(),tP=hd(),kS=tP.EPSILON_CLOSURE,rP=(function(){function t(e){Y6(this,t),this._nfa=e}return o(t,"DFA"),Q6(t,[{key:"minimize",value:o(function(){this.getTransitionTable(),this._originalAcceptingStateNumbers=this._acceptingStateNumbers,this._originalTransitionTable=this._transitionTable,eP.minimize(this)},"minimize")},{key:"getAlphabet",value:o(function(){return this._nfa.getAlphabet()},"getAlphabet")},{key:"getAcceptingStateNumbers",value:o(function(){return this._acceptingStateNumbers||this.getTransitionTable(),this._acceptingStateNumbers},"getAcceptingStateNumbers")},{key:"getOriginaAcceptingStateNumbers",value:o(function(){return this._originalAcceptingStateNumbers||this.getTransitionTable(),this._originalAcceptingStateNumbers},"getOriginaAcceptingStateNumbers")},{key:"setTransitionTable",value:o(function(r){this._transitionTable=r},"setTransitionTable")},{key:"setAcceptingStateNumbers",value:o(function(r){this._acceptingStateNumbers=r},"setAcceptingStateNumbers")},{key:"getTransitionTable",value:o(function(){var r=this;if(this._transitionTable)return this._transitionTable;var n=this._nfa.getTransitionTable(),i=Object.keys(n);this._acceptingStateNumbers=new Set;for(var s=n[i[0]][kS],u=[s],a=this.getAlphabet(),c=this._nfa.getAcceptingStateNumbers(),d={},h=o(function(Te){var V=!0,vt=!1,wr=void 0;try{for(var he=c[Symbol.iterator](),_r;!(V=(_r=he.next()).done);V=!0){var Ur=_r.value;if(Te.indexOf(Ur)!==-1){r._acceptingStateNumbers.add(Te.join(","));break}}}catch(un){vt=!0,wr=un}finally{try{!V&&he.return&&he.return()}finally{if(vt)throw wr}}},"updateAcceptingStates");u.length>0;){var y=u.shift(),b=y.join(",");d[b]={};var A=!0,S=!1,D=void 0;try{for(var I=a[Symbol.iterator](),J;!(A=(J=I.next()).done);A=!0){var pe=J.value,de=[];h(y);var xe=!0,ee=!1,ve=void 0;try{for(var ce=y[Symbol.iterator](),Ve;!(xe=(Ve=ce.next()).done);xe=!0){var It=Ve.value,mt=n[It][pe];if(mt){var Ft=!0,Dr=!1,sn=void 0;try{for(var gt=mt[Symbol.iterator](),qr;!(Ft=(qr=gt.next()).done);Ft=!0){var Xn=qr.value;n[Xn]&&de.push.apply(de,SS(n[Xn][kS]))}}catch(br){Dr=!0,sn=br}finally{try{!Ft&>.return&>.return()}finally{if(Dr)throw sn}}}}}catch(br){ee=!0,ve=br}finally{try{!xe&&ce.return&&ce.return()}finally{if(ee)throw ve}}var Mi=new Set(de),Mr=[].concat(SS(Mi));if(Mr.length>0){var Zn=Mr.join(",");d[b][pe]=Zn,d.hasOwnProperty(Zn)||u.unshift(Mr)}}}catch(br){S=!0,D=br}finally{try{!A&&I.return&&I.return()}finally{if(S)throw D}}}return this._transitionTable=this._remapStateNumbers(d)},"getTransitionTable")},{key:"_remapStateNumbers",value:o(function(r){var n={};this._originalTransitionTable=r;var i={};Object.keys(r).forEach(function(D,I){n[D]=I+1});for(var s in r){var u=r[s],a={};for(var c in u)a[c]=n[u[c]];i[n[s]]=a}this._originalAcceptingStateNumbers=this._acceptingStateNumbers,this._acceptingStateNumbers=new Set;var d=!0,h=!1,y=void 0;try{for(var b=this._originalAcceptingStateNumbers[Symbol.iterator](),A;!(d=(A=b.next()).done);d=!0){var S=A.value;this._acceptingStateNumbers.add(n[S])}}catch(D){h=!0,y=D}finally{try{!d&&b.return&&b.return()}finally{if(h)throw y}}return i},"_remapStateNumbers")},{key:"getOriginalTransitionTable",value:o(function(){return this._originalTransitionTable||this.getTransitionTable(),this._originalTransitionTable},"getOriginalTransitionTable")},{key:"matches",value:o(function(r){for(var n=1,i=0,s=this.getTransitionTable();r[i];)if(n=s[n][r[i++]],!n)return!1;return!!this.getAcceptingStateNumbers().has(n)},"matches")}]),t})();CS.exports=rP});var TS=K((Lre,PS)=>{"use strict";var nP=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function iP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(iP,"_classCallCheck");var oP=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.accepting,n=r===void 0?!1:r;iP(this,t),this._transitions=new Map,this.accepting=n}return o(t,"State"),nP(t,[{key:"getTransitions",value:o(function(){return this._transitions},"getTransitions")},{key:"addTransition",value:o(function(r,n){return this.getTransitionsOnSymbol(r).add(n),this},"addTransition")},{key:"getTransitionsOnSymbol",value:o(function(r){var n=this._transitions.get(r);return n||(n=new Set,this._transitions.set(r,n)),n},"getTransitionsOnSymbol")}]),t})();PS.exports=oP});var OS=K((Wre,IS)=>{"use strict";var sP=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function uP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(uP,"_classCallCheck");function aP(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}o(aP,"_possibleConstructorReturn");function cP(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}o(cP,"_inherits");var fP=TS(),dP=hd(),R1=dP.EPSILON,lP=(function(t){cP(e,t);function e(){return uP(this,e),aP(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,"NFAState"),sP(e,[{key:"matches",value:o(function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;if(i.has(this))return!1;if(i.add(this),n.length===0){if(this.accepting)return!0;var s=!0,u=!1,a=void 0;try{for(var c=this.getTransitionsOnSymbol(R1)[Symbol.iterator](),d;!(s=(d=c.next()).done);s=!0){var h=d.value;if(h.matches("",i))return!0}}catch(mt){u=!0,a=mt}finally{try{!s&&c.return&&c.return()}finally{if(u)throw a}}return!1}var y=n[0],b=n.slice(1),A=this.getTransitionsOnSymbol(y),S=!0,D=!1,I=void 0;try{for(var J=A[Symbol.iterator](),pe;!(S=(pe=J.next()).done);S=!0){var de=pe.value;if(de.matches(b))return!0}}catch(mt){D=!0,I=mt}finally{try{!S&&J.return&&J.return()}finally{if(D)throw I}}var xe=!0,ee=!1,ve=void 0;try{for(var ce=this.getTransitionsOnSymbol(R1)[Symbol.iterator](),Ve;!(xe=(Ve=ce.next()).done);xe=!0){var It=Ve.value;if(It.matches(n,i))return!0}}catch(mt){ee=!0,ve=mt}finally{try{!xe&&ce.return&&ce.return()}finally{if(ee)throw ve}}return!1},"matches")},{key:"getEpsilonClosure",value:o(function(){var n=this;return this._epsilonClosure||(function(){var i=n.getTransitionsOnSymbol(R1),s=n._epsilonClosure=new Set;s.add(n);var u=!0,a=!1,c=void 0;try{for(var d=i[Symbol.iterator](),h;!(u=(h=d.next()).done);u=!0){var y=h.value;if(!s.has(y)){s.add(y);var b=y.getEpsilonClosure();b.forEach(function(A){return s.add(A)})}}}catch(A){a=!0,c=A}finally{try{!u&&d.return&&d.return()}finally{if(a)throw c}}})(),this._epsilonClosure},"getEpsilonClosure")}]),e})(fP);IS.exports=lP});var j1=K((zre,jS)=>{"use strict";var Qp=I1(),La=OS(),pP=hd(),Wt=pP.EPSILON;function RS(t){var e=new La,r=new La({accepting:!0});return new Qp(e.addTransition(t,r),r)}o(RS,"char");function hP(){return RS(Wt)}o(hP,"e");function yP(t,e){return t.out.accepting=!1,e.out.accepting=!0,t.out.addTransition(Wt,e.in),new Qp(t.in,e.out)}o(yP,"altPair");function mP(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var i=!0,s=!1,u=void 0;try{for(var a=r[Symbol.iterator](),c;!(i=(c=a.next()).done);i=!0){var d=c.value;t=yP(t,d)}}catch(h){s=!0,u=h}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return t}o(mP,"alt");function gP(t,e){var r=new La,n=new La;return r.addTransition(Wt,t.in),r.addTransition(Wt,e.in),n.accepting=!0,t.out.accepting=!1,e.out.accepting=!1,t.out.addTransition(Wt,n),e.out.addTransition(Wt,n),new Qp(r,n)}o(gP,"orPair");function vP(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var i=!0,s=!1,u=void 0;try{for(var a=r[Symbol.iterator](),c;!(i=(c=a.next()).done);i=!0){var d=c.value;t=gP(t,d)}}catch(h){s=!0,u=h}finally{try{!i&&a.return&&a.return()}finally{if(s)throw u}}return t}o(vP,"or");function bP(t){var e=new La,r=new La({accepting:!0});return e.addTransition(Wt,t.in),e.addTransition(Wt,r),t.out.accepting=!1,t.out.addTransition(Wt,r),r.addTransition(Wt,t.in),new Qp(e,r)}o(bP,"repExplicit");function wP(t){return t.in.addTransition(Wt,t.out),t.out.addTransition(Wt,t.in),t}o(wP,"rep");function _P(t){return t.out.addTransition(Wt,t.in),t}o(_P,"plusRep");function xP(t){return t.in.addTransition(Wt,t.out),t}o(xP,"questionRep");jS.exports={alt:mP,char:RS,e:hP,or:vP,rep:wP,repExplicit:bP,plusRep:_P,questionRep:xP}});var DS=K((Jre,BS)=>{"use strict";function AP(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}o(AP,"_toConsumableArray");var SP=ld(),Ha=j1(),kP=Ha.alt,CP=Ha.char,EP=Ha.or,PP=Ha.rep,TP=Ha.plusRep,IP=Ha.questionRep;function Kn(t){if(t&&!NS[t.type])throw new Error(t.type+" is not supported in NFA/DFA interpreter.");return t?NS[t.type](t):""}o(Kn,"gen");var NS={RegExp:o(function(e){if(e.flags!=="")throw new Error("NFA/DFA: Flags are not supported yet.");return Kn(e.body)},"RegExp"),Alternative:o(function(e){var r=(e.expressions||[]).map(Kn);return kP.apply(void 0,AP(r))},"Alternative"),Disjunction:o(function(e){return EP(Kn(e.left),Kn(e.right))},"Disjunction"),Repetition:o(function(e){switch(e.quantifier.kind){case"*":return PP(Kn(e.expression));case"+":return TP(Kn(e.expression));case"?":return IP(Kn(e.expression));default:throw new Error("Unknown repeatition: "+e.quantifier.kind+".")}},"Repetition"),Char:o(function(e){if(e.kind!=="simple")throw new Error("NFA/DFA: Only simple chars are supported yet.");return CP(e.value)},"Char"),Group:o(function(e){return Kn(e.expression)},"Group")};BS.exports={build:o(function(e){var r=e;return e instanceof RegExp&&(e=""+e),typeof e=="string"&&(r=SP.parse(e,{captureLocations:!0})),Kn(r)},"build")}});var US=K((Xre,MS)=>{"use strict";var OP=I1(),qS=ES(),RP=DS(),jP=j1();MS.exports={NFA:OP,DFA:qS,builders:jP,toNFA:o(function(e){return RP.build(e)},"toNFA"),toDFA:o(function(e){return new qS(this.toNFA(e))},"toDFA"),test:o(function(e,r){return this.toDFA(e).matches(r)},"test")}});var VS=K((Qre,$S)=>{"use strict";var NP=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function BP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(BP,"_classCallCheck");var DP=(function(){function t(e,r){var n=r.flags,i=r.groups,s=r.source;BP(this,t),this._re=e,this._groups=i,this.flags=n,this.source=s||e.source,this.dotAll=n.includes("s"),this.global=e.global,this.ignoreCase=e.ignoreCase,this.multiline=e.multiline,this.sticky=e.sticky,this.unicode=e.unicode}return o(t,"RegExpTree"),NP(t,[{key:"test",value:o(function(r){return this._re.test(r)},"test")},{key:"compile",value:o(function(r){return this._re.compile(r)},"compile")},{key:"toString",value:o(function(){return this._toStringResult||(this._toStringResult="/"+this.source+"/"+this.flags),this._toStringResult},"toString")},{key:"exec",value:o(function(r){var n=this._re.exec(r);if(!this._groups||!n)return n;n.groups={};for(var i in this._groups){var s=this._groups[i];n.groups[i]=n[s]}return n},"exec")}]),t})();$S.exports={RegExpTree:DP}});var FS=K((ene,WS)=>{"use strict";var qP=l3(),MP=p1(),UP=mS(),LS=ld(),HS=Vp(),$P=x1(),VP=US(),LP=VS(),HP=LP.RegExpTree,WP={parser:LS,fa:VP,TransformResult:HS.TransformResult,parse:o(function(e,r){return LS.parse(""+e,r)},"parse"),traverse:o(function(e,r,n){return $P.traverse(e,r,n)},"traverse"),transform:o(function(e,r){return HS.transform(e,r)},"transform"),generate:o(function(e){return MP.generate(e)},"generate"),toRegExp:o(function(e){var r=this.compatTranspile(e);return new RegExp(r.getSource(),r.getFlags())},"toRegExp"),optimize:o(function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.blacklist;return UP.optimize(e,{whitelist:r,blacklist:i})},"optimize"),compatTranspile:o(function(e,r){return qP.transform(e,r)},"compatTranspile"),exec:o(function(e,r){if(typeof e=="string"){var n=this.compatTranspile(e),i=n.getExtra();i.namedCapturingGroups?e=new HP(n.toRegExp(),{flags:n.getFlags(),source:n.getSource(),groups:i.namedCapturingGroups}):e=n.toRegExp()}return e.exec(r)},"exec")};WS.exports=WP});var KS=K((rne,zS)=>{"use strict";zS.exports=FS()});var GS=K((nne,JS)=>{"use strict";var Yp=KS(),FP=l1(),B1=class B1 extends FP.Analyzer{constructor(e){super(e)}isVulnerable(e){return this._measureStarHeight(e)>1||this._measureRepetitions(e)>this.options.heuristic_replimit}genAttackString(e){return null}_measureStarHeight(e){let r=0,n=0,i=Yp.parse(e);return Yp.traverse(i,{Repetition:{pre({node:s}){r++,n<r&&(n=r)},post({node:s}){r--}}}),n}_measureRepetitions(e){let r=0,n=Yp.parse(e);return Yp.traverse(n,{Repetition:{pre({node:i}){r++}}}),r}};o(B1,"HeuristicAnalyzer");var N1=B1;JS.exports=N1});var ZS=K((one,XS)=>{"use strict";var zP=GS();XS.exports=[zP]});var YS=K((sne,QS)=>{"use strict";var KP=l1(),JP=ZS(),GP=25,XP=!0,ZP=!1,q1=class q1{constructor(e,r){this.regExp=e,this.analyzerOptions=r}};o(q1,"Args");var D1=q1;function QP(t,e){try{let r=YP(t,e);return eT(r).find(i=>i)?ZP:XP}catch{return!1}}o(QP,"safeRegex");function YP(t,e){e||(e={});let r=e.limit===void 0?GP:e.limit,n=new KP.AnalyzerOptions(r),i=null;return t instanceof RegExp?i=t:typeof t=="string"?i=new RegExp(t):i=new RegExp(String(t)),new D1(i,n)}o(YP,"buildArgs");function eT(t){let e=[],r;for(r of JP)try{let n=new r(t.analyzerOptions);e.push(n.isVulnerable(t.regExp))}catch{e.push(!1)}return e}o(eT,"askAnalyzersIfVulnerable");QS.exports=QP});var zT={};lh(zT,{AUTHORIZATION_CODE_GRANT:()=>sy,BuildDcqlPresentationError:()=>Gn,BuildPresentationError:()=>Di,CREDENTIAL_OFFER_SCHEMES:()=>C4,CredentialOfferParseError:()=>we,DEFAULT_JWE_ALG:()=>H1,DEFAULT_JWE_ENC:()=>W1,DEFAULT_STORE_PLUGIN:()=>t_,JarmEncryptError:()=>tt,OID4VCI_PROOF_TYP:()=>Gw,PRE_AUTHORIZED_CODE_GRANT:()=>ei,PkceError:()=>ri,RequestObjectError:()=>Q,SiopSignError:()=>Jn,VciError:()=>B,VpError:()=>re,VpSignError:()=>er,VpSubmitError:()=>tr,acceptCredentialOffer:()=>Ud,adaptCredentialForDcql:()=>G1,adaptCredentialsForDcql:()=>oh,assembleDcqlVpToken:()=>Q1,beginAuthCodeFlow:()=>uy,buildAuthorizationUrl:()=>Qw,buildDcqlPresentations:()=>uh,buildDcqlQuery:()=>nw,buildDcqlResponse:()=>ah,buildPresentation:()=>md,buildPresentationSubmission:()=>s4,buildProofJwt:()=>dc,builtInDidResolver:()=>i1,completeAuthCodeFlow:()=>ay,computeS256Challenge:()=>iy,createJoseEd25519Signer:()=>Md,encryptResponseObject:()=>nh,evaluateField:()=>U1,exchangeAuthorizationCode:()=>Yw,exchangePreAuthorizedCode:()=>gh,fetchAuthorizationServerMetadata:()=>Ya,fetchCredentialIssuerMetadata:()=>Qa,generatePkcePair:()=>ny,getOpenID4VCPlugin:()=>d4,inferCredentialFormat:()=>yd,matchInputDescriptor:()=>th,normalizeCredentialOffer:()=>_d,normalizeIssuedCredential:()=>cy,parseAuthorizationRequestUri:()=>ud,parseCredentialOfferUri:()=>xd,parseDcqlQuery:()=>Ni,queryJsonPath:()=>$1,requestCredential:()=>lc,requestW3cVc:()=>p4,requiresIdToken:()=>ih,resolveAuthorizationRequest:()=>ad,resolveAuthorizationServer:()=>ec,resolveCredentialOfferByReference:()=>hh,resolvePresentationDefinitionByReference:()=>s1,responseTypeSet:()=>K1,satisfiesFilter:()=>Wa,selectCredentials:()=>rh,selectCredentialsForDcql:()=>sh,signDcqlPresentations:()=>Z1,signIdToken:()=>vd,signPresentation:()=>qi,storeAcceptedCredentials:()=>fy,submitPresentation:()=>Fa,verifyAndDecodeRequestObject:()=>jp,verifyPkce:()=>_5});module.exports=k4(zT);var ei="urn:ietf:params:oauth:grant-type:pre-authorized_code",C4=["openid-credential-offer","haip"],ph=class ph extends Error{constructor(e,r){super(r),this.name="CredentialOfferParseError",this.code=e}};o(ph,"CredentialOfferParseError");var we=ph;var an=o(t=>typeof t=="string"&&t.length>0,"isNonEmptyString"),_d=o(t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new we("invalid_json","Credential offer must be a JSON object");let e=t;if(!an(e.credential_issuer))throw new we("missing_issuer","Credential offer is missing `credential_issuer`");let r=e.credential_issuer;if(Array.isArray(e.credential_configuration_ids)){let n=e.credential_configuration_ids.filter(an);if(n.length===0)throw new we("missing_credentials","Credential offer `credential_configuration_ids` is empty");return{credential_issuer:r,credential_configuration_ids:n,grants:sw(e.grants)}}if(Array.isArray(e.credentials)){let i=e.credentials.map(s=>{if(typeof s=="string")return s;if(typeof s=="object"&&s!==null){let u=s;if(an(u.id))return u.id;if(Array.isArray(u.types)&&u.types.length>0&&an(u.types[0]))return u.types[0]}return null}).filter(an);if(i.length===0)throw new we("missing_credentials","Credential offer `credentials` array did not contain any resolvable identifiers");return{credential_issuer:r,credential_configuration_ids:i,grants:sw(e.grants,{legacy:!0})}}throw new we("missing_credentials","Credential offer must include `credential_configuration_ids` (Draft 13) or `credentials` (Draft 11)")},"normalizeCredentialOffer"),sw=o((t,e={})=>{if(t==null)return;if(typeof t!="object"||Array.isArray(t))throw new we("invalid_grants","`grants` must be a JSON object");let r=t,n={},i=r[ei];if(i&&typeof i=="object"&&!Array.isArray(i)){let u=i,a=u["pre-authorized_code"];if(!an(a))throw new we("invalid_grants","Pre-authorized code grant is missing `pre-authorized_code`");let c={"pre-authorized_code":a,interval:typeof u.interval=="number"?u.interval:void 0,authorization_server:an(u.authorization_server)?u.authorization_server:void 0};u.tx_code&&typeof u.tx_code=="object"&&!Array.isArray(u.tx_code)?c.tx_code=u.tx_code:e.legacy&&u.user_pin_required===!0&&(c.tx_code={}),n[ei]=c}let s=r.authorization_code;if(s&&typeof s=="object"&&!Array.isArray(s)){let u=s;n.authorization_code={issuer_state:an(u.issuer_state)?u.issuer_state:void 0,authorization_server:an(u.authorization_server)?u.authorization_server:void 0}}if(Object.keys(n).length!==0)return n},"normalizeGrants");var xd=o(t=>{if(typeof t!="string"||t.trim().length===0)throw new we("invalid_uri","Offer URI must be a non-empty string");let e=E4(t.trim()),r=e.get("credential_offer"),n=e.get("credential_offer_uri");if(r&&n)throw new we("both_offer_and_uri","Credential offer URI must contain exactly one of `credential_offer` or `credential_offer_uri`, not both");if(n){if(!uw(n))throw new we("invalid_uri","`credential_offer_uri` must be an absolute https:// URL");return{kind:"by_reference",uri:n}}if(r){let i;try{i=JSON.parse(r)}catch{throw new we("invalid_json","`credential_offer` value is not valid JSON")}return{kind:"by_value",offer:_d(i)}}throw new we("missing_offer","Credential offer URI must contain `credential_offer` or `credential_offer_uri`")},"parseCredentialOfferUri"),hh=o(async(t,e=globalThis.fetch)=>{if(typeof e!="function")throw new we("invalid_uri","No fetch implementation available to resolve credential_offer_uri");if(!uw(t))throw new we("invalid_uri","credential_offer_uri must be an absolute https:// URL");let r;try{r=await e(t,{method:"GET"})}catch(i){throw new we("invalid_uri",`Failed to fetch credential_offer_uri: ${i instanceof Error?i.message:String(i)}`)}if(!r.ok)throw new we("invalid_uri",`credential_offer_uri returned ${r.status} ${r.statusText}`);let n;try{n=await r.json()}catch{throw new we("invalid_json","credential_offer_uri response was not valid JSON")}return{kind:"by_value",offer:_d(n)}},"resolveCredentialOfferByReference"),E4=o(t=>{let e=t.indexOf("?");if(e!==-1)return new URLSearchParams(t.slice(e+1));if(t.includes("://")||/^[a-z][a-z0-9+.-]*:/i.test(t))throw new we("invalid_uri","Offer URI has no query string");if(t.includes("="))return new URLSearchParams(t);throw new we("invalid_uri","Offer URI has no query string")},"extractSearchParams"),uw=o(t=>{try{return new URL(t).protocol==="https:"}catch{return!1}},"isHttpsUrl");var yh=class yh extends Error{constructor(e,r,n={}){super(r),this.name="VciError",this.code=e,this.status=n.status,this.body=n.body,n.cause!==void 0&&(this.cause=n.cause)}};o(yh,"VciError");var B=yh;var P4="/.well-known/openid-credential-issuer",T4="/.well-known/oauth-authorization-server",I4="/.well-known/openid-configuration",Qa=o(async(t,e=globalThis.fetch)=>{if(typeof e!="function")throw new B("metadata_fetch_failed","No fetch implementation available for issuer metadata");let r=mh(t,P4),n=await j4(r,e,"metadata_fetch_failed");if(!cw(n))throw new B("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 B("metadata_invalid","Issuer metadata is missing `credential_issuer`",{body:n});if(typeof n.credential_endpoint!="string"||n.credential_endpoint.length===0)throw new B("metadata_invalid","Issuer metadata is missing `credential_endpoint`",{body:n});if(!O4(n.credential_issuer,t))throw new B("metadata_issuer_mismatch",`Issuer metadata advertises \`credential_issuer\` as ${n.credential_issuer} but was fetched for ${t}`,{body:n});return n},"fetchCredentialIssuerMetadata"),Ya=o(async(t,e=globalThis.fetch)=>{if(typeof e!="function")throw new B("metadata_fetch_failed","No fetch implementation available for authorization-server metadata");let r=mh(t,T4),n=o(async s=>{let u;try{u=await e(s,{method:"GET"})}catch{return null}if(!u.ok)return null;try{return await u.json()}catch{return null}},"tryUrl"),i=await n(r);if(i==null){let s=mh(t,I4);i=await n(s)}if(i==null)throw new B("metadata_fetch_failed",`Authorization server metadata not reachable at ${r} or the OIDC fallback`);if(!cw(i))throw new B("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 B("metadata_invalid","Authorization server metadata is missing `token_endpoint`",{body:i});return i},"fetchAuthorizationServerMetadata"),ec=o((t,e)=>e&&e.length>0?e:Array.isArray(t.authorization_servers)&&t.authorization_servers.length>0&&typeof t.authorization_servers[0]=="string"?t.authorization_servers[0]:t.credential_issuer,"resolveAuthorizationServer"),mh=o((t,e)=>{let r=t.length;for(;r>0&&t.charCodeAt(r-1)===47;)r--;return`${t.slice(0,r)}${e}`},"joinWellKnown"),O4=o((t,e)=>aw(t)===aw(e),"originsMatch"),aw=o(t=>{let e=t.length;for(;e>0&&t.charCodeAt(e-1)===47;)e--;let r=t.slice(0,e),n=r.indexOf("://");if(n<=0)return r;let i=r.slice(0,n);return R4(i)?`${i.toLowerCase()}${r.slice(n)}`:r},"normalizeIssuerId"),R4=o(t=>{if(t.length===0)return!1;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),n=r>=65&&r<=90,i=r>=97&&r<=122;if(!n&&!i)return!1}return!0},"isAsciiAlpha"),cw=o(t=>typeof t=="object"&&t!==null&&!Array.isArray(t),"isObject"),j4=o(async(t,e,r)=>{let n;try{n=await e(t,{method:"GET"})}catch(i){throw new B(r,`Failed to fetch ${t}: ${i instanceof Error?i.message:String(i)}`,{cause:i})}if(!n.ok)throw new B(r,`Fetch of ${t} returned ${n.status} ${n.statusText}`,{status:n.status});try{return await n.json()}catch(i){throw new B(r,`Response from ${t} was not valid JSON`,{cause:i})}},"getJson");var gh=o(async t=>{let{tokenEndpoint:e,preAuthorizedCode:r,txCode:n,clientId:i}=t,s=t.fetchImpl??globalThis.fetch;if(typeof s!="function")throw new B("token_request_failed","No fetch implementation available for token exchange");let u=new URLSearchParams;u.set("grant_type",ei),u.set("pre-authorized_code",r),typeof n=="string"&&n.length>0&&u.set("tx_code",n),typeof i=="string"&&i.length>0&&u.set("client_id",i);let a;try{a=await s(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:u.toString()})}catch(d){throw new B("token_request_failed",`Token endpoint ${e} unreachable: ${d instanceof Error?d.message:String(d)}`,{cause:d})}let c;try{c=await a.json()}catch(d){throw new B("token_response_invalid",`Token endpoint ${e} returned non-JSON body`,{status:a.status,cause:d})}if(!a.ok){let d=c,h=typeof d?.error=="string"?d.error:"unknown",y=typeof d?.error_description=="string"?`: ${d.error_description}`:"";throw new B("token_request_failed",`Token endpoint returned ${a.status} (${h})${y}`,{status:a.status,body:c})}if(!N4(c))throw new B("token_response_invalid","Token endpoint response is missing required `access_token` / `token_type`",{status:a.status,body:c});return c},"exchangePreAuthorizedCode"),N4=o(t=>{if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.access_token=="string"&&e.access_token.length>0&&typeof e.token_type=="string"&&e.token_type.length>0},"isTokenResponse");var te=crypto,Fe=o(t=>t instanceof CryptoKey,"isCryptoKey");var B4=o(async(t,e)=>{let r=`SHA-${t.slice(-3)}`;return new Uint8Array(await te.subtle.digest(r,e))},"digest"),fw=B4;var Ne=new TextEncoder,rt=new TextDecoder,Ad=2**32;function rr(...t){let e=t.reduce((i,{length:s})=>i+s,0),r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}o(rr,"concat");function dw(t,e){return rr(Ne.encode(t),new Uint8Array([0]),e)}o(dw,"p2s");function vh(t,e,r){if(e<0||e>=Ad)throw new RangeError(`value must be >= 0 and <= ${Ad-1}. Received ${e}`);t.set([e>>>24,e>>>16,e>>>8,e&255],r)}o(vh,"writeUInt32BE");function lw(t){let e=Math.floor(t/Ad),r=t%Ad,n=new Uint8Array(8);return vh(n,e,0),vh(n,r,4),n}o(lw,"uint64be");function Sd(t){let e=new Uint8Array(4);return vh(e,t),e}o(Sd,"uint32be");function kd(t){return rr(Sd(t.length),t)}o(kd,"lengthAndInput");async function pw(t,e,r){let n=Math.ceil((e>>3)/32),i=new Uint8Array(n*32);for(let s=0;s<n;s++){let u=new Uint8Array(4+t.length+r.length);u.set(Sd(s+1)),u.set(t,4),u.set(r,4+t.length),i.set(await fw("sha256",u),s*32)}return i.slice(0,e>>3)}o(pw,"concatKdf");var bh=o(t=>{let e=t;typeof e=="string"&&(e=Ne.encode(e));let r=32768,n=[];for(let i=0;i<e.length;i+=r)n.push(String.fromCharCode.apply(null,e.subarray(i,i+r)));return btoa(n.join(""))},"encodeBase64"),Be=o(t=>bh(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),"encode"),wh=o(t=>{let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r},"decodeBase64"),nr=o(t=>{let e=t;e instanceof Uint8Array&&(e=rt.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return wh(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}},"decode");var Eh=class Eh extends Error{constructor(e,r){super(e,r),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};o(Eh,"JOSEError");var nt=Eh;nt.code="ERR_JOSE_GENERIC";var Ph=class Ph extends nt{constructor(e,r,n="unspecified",i="unspecified"){super(e,{cause:{claim:n,reason:i,payload:r}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=n,this.reason=i,this.payload=r}};o(Ph,"JWTClaimValidationFailed");var Ot=Ph;Ot.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var Th=class Th extends nt{constructor(e,r,n="unspecified",i="unspecified"){super(e,{cause:{claim:n,reason:i,payload:r}}),this.code="ERR_JWT_EXPIRED",this.claim=n,this.reason=i,this.payload=r}};o(Th,"JWTExpired");var qo=Th;qo.code="ERR_JWT_EXPIRED";var Ih=class Ih extends nt{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}};o(Ih,"JOSEAlgNotAllowed");var tc=Ih;tc.code="ERR_JOSE_ALG_NOT_ALLOWED";var Oh=class Oh extends nt{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}};o(Oh,"JOSENotSupported");var ye=Oh;ye.code="ERR_JOSE_NOT_SUPPORTED";var Rh=class Rh extends nt{constructor(e="decryption operation failed",r){super(e,r),this.code="ERR_JWE_DECRYPTION_FAILED"}};o(Rh,"JWEDecryptionFailed");var _h=Rh;_h.code="ERR_JWE_DECRYPTION_FAILED";var jh=class jh extends nt{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}};o(jh,"JWEInvalid");var wt=jh;wt.code="ERR_JWE_INVALID";var Nh=class Nh extends nt{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}};o(Nh,"JWSInvalid");var be=Nh;be.code="ERR_JWS_INVALID";var Bh=class Bh extends nt{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}};o(Bh,"JWTInvalid");var it=Bh;it.code="ERR_JWT_INVALID";var Dh=class Dh extends nt{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}};o(Dh,"JWKInvalid");var xh=Dh;xh.code="ERR_JWK_INVALID";var qh=class qh extends nt{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}};o(qh,"JWKSInvalid");var Ah=qh;Ah.code="ERR_JWKS_INVALID";var Mh=class Mh extends nt{constructor(e="no applicable key found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_NO_MATCHING_KEY"}};o(Mh,"JWKSNoMatchingKey");var Sh=Mh;Sh.code="ERR_JWKS_NO_MATCHING_KEY";var Uh=class Uh extends nt{constructor(e="multiple matching keys found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}};o(Uh,"JWKSMultipleMatchingKeys");var kh=Uh;kh.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var $h=class $h extends nt{constructor(e="request timed out",r){super(e,r),this.code="ERR_JWKS_TIMEOUT"}};o($h,"JWKSTimeout");var Ch=$h;Ch.code="ERR_JWKS_TIMEOUT";var Vh=class Vh extends nt{constructor(e="signature verification failed",r){super(e,r),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}};o(Vh,"JWSSignatureVerificationFailed");var rc=Vh;rc.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";var Mo=te.getRandomValues.bind(te);function Lh(t){switch(t){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 ye(`Unsupported JWE Algorithm: ${t}`)}}o(Lh,"bitLength");var hw=o(t=>Mo(new Uint8Array(Lh(t)>>3)),"default");var M4=o((t,e)=>{if(e.length<<3!==Lh(t))throw new wt("Invalid Initialization Vector length")},"checkIvLength"),yw=M4;var U4=o((t,e)=>{let r=t.byteLength<<3;if(r!==e)throw new wt(`Invalid Content Encryption Key length. Expected ${e} bits, got ${r} bits`)},"checkCekLength"),Hh=U4;function et(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}o(et,"unusable");function cn(t,e){return t.name===e}o(cn,"isAlgorithm");function Cd(t){return parseInt(t.name.slice(4),10)}o(Cd,"getHashLength");function $4(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}o($4,"getNamedCurve");function mw(t,e){if(e.length&&!e.some(r=>t.usages.includes(r))){let r="CryptoKey does not support this operation, its usages must include ";if(e.length>2){let n=e.pop();r+=`one of ${e.join(", ")}, or ${n}.`}else e.length===2?r+=`one of ${e[0]} or ${e[1]}.`:r+=`${e[0]}.`;throw new TypeError(r)}}o(mw,"checkUsage");function gw(t,e,...r){switch(e){case"HS256":case"HS384":case"HS512":{if(!cn(t.algorithm,"HMAC"))throw et("HMAC");let n=parseInt(e.slice(2),10);if(Cd(t.algorithm.hash)!==n)throw et(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!cn(t.algorithm,"RSASSA-PKCS1-v1_5"))throw et("RSASSA-PKCS1-v1_5");let n=parseInt(e.slice(2),10);if(Cd(t.algorithm.hash)!==n)throw et(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!cn(t.algorithm,"RSA-PSS"))throw et("RSA-PSS");let n=parseInt(e.slice(2),10);if(Cd(t.algorithm.hash)!==n)throw et(`SHA-${n}`,"algorithm.hash");break}case"EdDSA":{if(t.algorithm.name!=="Ed25519"&&t.algorithm.name!=="Ed448")throw et("Ed25519 or Ed448");break}case"Ed25519":{if(!cn(t.algorithm,"Ed25519"))throw et("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!cn(t.algorithm,"ECDSA"))throw et("ECDSA");let n=$4(e);if(t.algorithm.namedCurve!==n)throw et(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}mw(t,r)}o(gw,"checkSigCryptoKey");function Sr(t,e,...r){switch(e){case"A128GCM":case"A192GCM":case"A256GCM":{if(!cn(t.algorithm,"AES-GCM"))throw et("AES-GCM");let n=parseInt(e.slice(1,4),10);if(t.algorithm.length!==n)throw et(n,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!cn(t.algorithm,"AES-KW"))throw et("AES-KW");let n=parseInt(e.slice(1,4),10);if(t.algorithm.length!==n)throw et(n,"algorithm.length");break}case"ECDH":{switch(t.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw et("ECDH, X25519, or X448")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!cn(t.algorithm,"PBKDF2"))throw et("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!cn(t.algorithm,"RSA-OAEP"))throw et("RSA-OAEP");let n=parseInt(e.slice(9),10)||1;if(Cd(t.algorithm.hash)!==n)throw et(`SHA-${n}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}mw(t,r)}o(Sr,"checkEncCryptoKey");function vw(t,e,...r){if(r=r.filter(Boolean),r.length>2){let n=r.pop();t+=`one of type ${r.join(", ")}, or ${n}.`}else r.length===2?t+=`one of type ${r[0]} or ${r[1]}.`:t+=`of type ${r[0]}.`;return e==null?t+=` Received ${e}`:typeof e=="function"&&e.name?t+=` Received function ${e.name}`:typeof e=="object"&&e!=null&&e.constructor?.name&&(t+=` Received an instance of ${e.constructor.name}`),t}o(vw,"message");var Xe=o((t,...e)=>vw("Key must be ",t,...e),"default");function Wh(t,e,...r){return vw(`Key for the ${t} algorithm must be `,e,...r)}o(Wh,"withAlg");var Fh=o(t=>Fe(t)?!0:t?.[Symbol.toStringTag]==="KeyObject","default"),We=["CryptoKey"];var V4=o((...t)=>{let e=t.filter(Boolean);if(e.length===0||e.length===1)return!0;let r;for(let n of e){let i=Object.keys(n);if(!r||r.size===0){r=new Set(i);continue}for(let s of i){if(r.has(s))return!1;r.add(s)}}return!0},"isDisjoint"),Uo=V4;function L4(t){return typeof t=="object"&&t!==null}o(L4,"isObjectLike");function pt(t){if(!L4(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}o(pt,"isObject");var H4=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]],Ed=H4;function W4(t,e){if(t.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${e}`)}o(W4,"checkKeySize");function F4(t,e,r){if(Fe(t))return Sr(t,e,r),t;if(t instanceof Uint8Array)return te.subtle.importKey("raw",t,"AES-KW",!0,[r]);throw new TypeError(Xe(t,...We,"Uint8Array"))}o(F4,"getCryptoKey");var nc=o(async(t,e,r)=>{let n=await F4(e,t,"wrapKey");W4(n,t);let i=await te.subtle.importKey("raw",r,...Ed);return new Uint8Array(await te.subtle.wrapKey("raw",i,n,"AES-KW"))},"wrap");async function bw(t,e,r,n,i=new Uint8Array(0),s=new Uint8Array(0)){if(!Fe(t))throw new TypeError(Xe(t,...We));if(Sr(t,"ECDH"),!Fe(e))throw new TypeError(Xe(e,...We));Sr(e,"ECDH","deriveBits");let u=rr(kd(Ne.encode(r)),kd(i),kd(s),Sd(n)),a;t.algorithm.name==="X25519"?a=256:t.algorithm.name==="X448"?a=448:a=Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3),10)/8)<<3;let c=new Uint8Array(await te.subtle.deriveBits({name:t.algorithm.name,public:t},e,a));return pw(c,n,u)}o(bw,"deriveKey");async function ww(t){if(!Fe(t))throw new TypeError(Xe(t,...We));return te.subtle.generateKey(t.algorithm,!0,["deriveBits"])}o(ww,"generateEpk");function _w(t){if(!Fe(t))throw new TypeError(Xe(t,...We));return["P-256","P-384","P-521"].includes(t.algorithm.namedCurve)||t.algorithm.name==="X25519"||t.algorithm.name==="X448"}o(_w,"ecdhAllowed");function zh(t){if(!(t instanceof Uint8Array)||t.length<8)throw new wt("PBES2 Salt Input must be 8 or more octets")}o(zh,"checkP2s");function K4(t,e){if(t instanceof Uint8Array)return te.subtle.importKey("raw",t,"PBKDF2",!1,["deriveBits"]);if(Fe(t))return Sr(t,e,"deriveBits","deriveKey"),t;throw new TypeError(Xe(t,...We,"Uint8Array"))}o(K4,"getCryptoKey");async function J4(t,e,r,n){zh(t);let i=dw(e,t),s=parseInt(e.slice(13,16),10),u={hash:`SHA-${e.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},a={length:s,name:"AES-KW"},c=await K4(n,e);if(c.usages.includes("deriveBits"))return new Uint8Array(await te.subtle.deriveBits(u,c,s));if(c.usages.includes("deriveKey"))return te.subtle.deriveKey(u,c,a,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}o(J4,"deriveKey");var xw=o(async(t,e,r,n=2048,i=Mo(new Uint8Array(16)))=>{let s=await J4(i,t,n,e);return{encryptedKey:await nc(t.slice(-6),s,r),p2c:n,p2s:Be(i)}},"encrypt");function Pd(t){switch(t){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new ye(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}o(Pd,"subtleRsaEs");var $o=o((t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){let{modulusLength:r}=e.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}},"default");var Aw=o(async(t,e,r)=>{if(!Fe(e))throw new TypeError(Xe(e,...We));if(Sr(e,t,"encrypt","wrapKey"),$o(t,e),e.usages.includes("encrypt"))return new Uint8Array(await te.subtle.encrypt(Pd(t),e,r));if(e.usages.includes("wrapKey")){let n=await te.subtle.importKey("raw",r,...Ed);return new Uint8Array(await te.subtle.wrapKey("raw",n,e,Pd(t)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},"encrypt");function fn(t){return pt(t)&&typeof t.kty=="string"}o(fn,"isJWK");function Sw(t){return t.kty!=="oct"&&typeof t.d=="string"}o(Sw,"isPrivateJWK");function kw(t){return t.kty!=="oct"&&typeof t.d>"u"}o(kw,"isPublicJWK");function Cw(t){return fn(t)&&t.kty==="oct"&&typeof t.k=="string"}o(Cw,"isSecretJWK");function X4(t){let e,r;switch(t.kty){case"RSA":{switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`},r=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`},r=t.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(t.alg.slice(-3),10)||1}`},r=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new ye('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},r=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},r=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},r=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},r=t.d?["deriveBits"]:[];break;default:throw new ye('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(t.alg){case"Ed25519":e={name:"Ed25519"},r=t.d?["sign"]:["verify"];break;case"EdDSA":e={name:t.crv},r=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv},r=t.d?["deriveBits"]:[];break;default:throw new ye('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new ye('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:r}}o(X4,"subtleMapping");var Z4=o(async t=>{if(!t.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:e,keyUsages:r}=X4(t),n=[e,t.ext??!1,t.key_ops??r],i={...t};return delete i.alg,delete i.use,te.subtle.importKey("jwk",i,...n)},"parse"),Td=Z4;var Ew=o(t=>nr(t),"exportKeyValue"),Vo,Lo,Pw=o(t=>t?.[Symbol.toStringTag]==="KeyObject","isKeyObject"),Id=o(async(t,e,r,n,i=!1)=>{let s=t.get(e);if(s?.[n])return s[n];let u=await Td({...r,alg:n});return i&&Object.freeze(e),s?s[n]=u:t.set(e,{[n]:u}),u},"importAndCache"),Q4=o((t,e)=>{if(Pw(t)){let r=t.export({format:"jwk"});return delete r.d,delete r.dp,delete r.dq,delete r.p,delete r.q,delete r.qi,r.k?Ew(r.k):(Lo||(Lo=new WeakMap),Id(Lo,t,r,e))}return fn(t)?t.k?nr(t.k):(Lo||(Lo=new WeakMap),Id(Lo,t,t,e,!0)):t},"normalizePublicKey"),Y4=o((t,e)=>{if(Pw(t)){let r=t.export({format:"jwk"});return r.k?Ew(r.k):(Vo||(Vo=new WeakMap),Id(Vo,t,r,e))}return fn(t)?t.k?nr(t.k):(Vo||(Vo=new WeakMap),Id(Vo,t,t,e,!0)):t},"normalizePrivateKey"),ic={normalizePublicKey:Q4,normalizePrivateKey:Y4};function Kh(t){switch(t){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 ye(`Unsupported JWE Algorithm: ${t}`)}}o(Kh,"bitLength");var Ho=o(t=>Mo(new Uint8Array(Kh(t)>>3)),"default");var Tw=o((t,e)=>{let r=(t.match(/.{1,64}/g)||[]).join(`
|
|
8
8
|
`);return`-----BEGIN ${e}-----
|
|
9
9
|
${r}
|
|
10
|
-
-----END ${e}-----`},"default");var In=o((t,e,r=0)=>{r===0&&(e.unshift(e.length),e.unshift(6));let n=t.indexOf(e[0],r);if(n===-1)return!1;let i=t.subarray(n,n+e.length);return i.length!==e.length?!1:i.every((s,u)=>s===e[u])||In(t,e,n+1)},"findOid"),Y1=o(t=>{switch(!0){case In(t,[42,134,72,206,61,3,1,7]):return"P-256";case In(t,[43,129,4,0,34]):return"P-384";case In(t,[43,129,4,0,35]):return"P-521";case In(t,[43,101,110]):return"X25519";case In(t,[43,101,111]):return"X448";case In(t,[43,101,112]):return"Ed25519";case In(t,[43,101,113]):return"Ed448";default:throw new pe("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},"getNamedCurve"),yS=o(async(t,e,r,n,i)=>{let s,u,a=new Uint8Array(atob(r.replace(t,"")).split("").map(d=>d.charCodeAt(0))),c=e==="spki";switch(n){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},u=c?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},u=c?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},u=c?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},u=c?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},u=c?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},u=c?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let d=Y1(a);s=d.startsWith("P-")?{name:"ECDH",namedCurve:d}:{name:d},u=c?[]:["deriveBits"];break}case"Ed25519":s={name:"Ed25519"},u=c?["verify"]:["sign"];break;case"EdDSA":s={name:Y1(a)},u=c?["verify"]:["sign"];break;default:throw new pe('Invalid or unsupported "alg" (Algorithm) value')}return ee.subtle.importKey(e,a,s,i?.extractable??!1,u)},"genericImport");var tw=o((t,e,r)=>yS(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",t,e,r),"fromSPKI");function ew(t){let e=[],r=0;for(;r<t.length;){let n=rw(t.subarray(r));e.push(n),r+=n.byteLength}return e}o(ew,"getElement");function rw(t){let e=0,r=t[0]&31;if(e++,r===31){for(r=0;t[e]>=128;)r=r*128+t[e]-128,e++;r=r*128+t[e]-128,e++}let n=0;if(t[e]<128)n=t[e],e++;else if(n===128){for(n=0;t[e+n]!==0||t[e+n+1]!==0;){if(n>t.byteLength)throw new TypeError("invalid indefinite form length");n++}let s=e+n+2;return{byteLength:s,contents:t.subarray(e,e+n),raw:t.subarray(0,s)}}else{let s=t[e]&127;e++,n=0;for(let u=0;u<s;u++)n=n*256+t[e],e++}let i=e+n;return{byteLength:i,contents:t.subarray(e,i),raw:t.subarray(0,i)}}o(rw,"parseElement");function mS(t){let e=ew(ew(rw(t).contents)[0].contents);return Zp(e[e[0].raw[0]===160?6:5].raw)}o(mS,"spkiFromX509");function gS(t){let e=t.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),r=Qp(e);return Q1(mS(r),"PUBLIC KEY")}o(gS,"getSPKI");var nw=o((t,e,r)=>{let n;try{n=gS(t)}catch(i){throw new TypeError("Failed to parse the X.509 certificate",{cause:i})}return tw(n,e,r)},"fromX509");async function pd(t,e,r){if(typeof t!="string"||t.indexOf("-----BEGIN CERTIFICATE-----")!==0)throw new TypeError('"x509" must be X.509 formatted string');return nw(t,e,r)}o(pd,"importX509");async function Xr(t,e){if(!nt(t))throw new TypeError("JWK must be an object");switch(e||(e=t.alg),t.kty){case"oct":if(typeof t.k!="string"||!t.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Kt(t.k);case"RSA":if("oth"in t&&t.oth!==void 0)throw new pe('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return dd({...t,alg:e});default:throw new pe('Unsupported "kty" (Key Type) Parameter value')}}o(Xr,"importJWK");var Io=o(t=>t?.[Symbol.toStringTag],"tag"),Ch=o((t,e,r)=>{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?.(r)!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${r}`);if(e.alg!==void 0&&e.alg!==t)throw new TypeError(`Invalid key for this operation, when present its alg must be ${t}`);return!0},"jwkMatchesOp"),vS=o((t,e,r,n)=>{if(!(e instanceof Uint8Array)){if(n&&Gr(e)){if(G1(e)&&Ch(t,e,r))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(!Ah(e))throw new TypeError(xh(t,e,...qe,"Uint8Array",n?"JSON Web Key":null));if(e.type!=="secret")throw new TypeError(`${Io(e)} instances for symmetric algorithms must be of type "secret"`)}},"symmetricTypeCheck"),bS=o((t,e,r,n)=>{if(n&&Gr(e))switch(r){case"sign":if(J1(e)&&Ch(t,e,r))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(z1(e)&&Ch(t,e,r))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Ah(e))throw new TypeError(xh(t,e,...qe,n?"JSON Web Key":null));if(e.type==="secret")throw new TypeError(`${Io(e)} instances for asymmetric algorithms must not be of type "secret"`);if(r==="sign"&&e.type==="public")throw new TypeError(`${Io(e)} instances for asymmetric algorithm signing must be of type "private"`);if(r==="decrypt"&&e.type==="public")throw new TypeError(`${Io(e)} instances for asymmetric algorithm decryption must be of type "private"`);if(e.algorithm&&r==="verify"&&e.type==="private")throw new TypeError(`${Io(e)} instances for asymmetric algorithm verifying must be of type "public"`);if(e.algorithm&&r==="encrypt"&&e.type==="private")throw new TypeError(`${Io(e)} instances for asymmetric algorithm encryption must be of type "public"`)},"asymmetricTypeCheck");function iw(t,e,r,n){e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?vS(e,r,n,t):bS(e,r,n,t)}o(iw,"checkKeyType");var ow=iw.bind(void 0,!1),Fa=iw.bind(void 0,!0);async function wS(t,e,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Fe(r,"Uint8Array"));let s=parseInt(t.slice(1,4),10),u=await ee.subtle.importKey("raw",r.subarray(s>>3),"AES-CBC",!1,["encrypt"]),a=await ee.subtle.importKey("raw",r.subarray(0,s>>3),{hash:`SHA-${s<<1}`,name:"HMAC"},!1,["sign"]),c=new Uint8Array(await ee.subtle.encrypt({iv:n,name:"AES-CBC"},u,e)),d=Ft(i,n,c,B1(i.length<<3)),p=new Uint8Array((await ee.subtle.sign("HMAC",a,d)).slice(0,s>>3));return{ciphertext:c,tag:p,iv:n}}o(wS,"cbcEncrypt");async function _S(t,e,r,n,i){let s;r instanceof Uint8Array?s=await ee.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(ar(r,t,"encrypt"),s=r);let u=new Uint8Array(await ee.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},s,e)),a=u.slice(-16);return{ciphertext:u.slice(0,-16),tag:a,iv:n}}o(_S,"gcmEncrypt");var xS=o(async(t,e,r,n,i)=>{if(!Me(r)&&!(r instanceof Uint8Array))throw new TypeError(Fe(r,...qe,"Uint8Array"));switch(n?M1(t,n):n=q1(t),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&_h(r,parseInt(t.slice(-3),10)),wS(t,e,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&_h(r,parseInt(t.slice(1,4),10)),_S(t,e,r,n,i);default:throw new pe("Unsupported JWE Content Encryption Algorithm")}},"encrypt"),hd=xS;async function sw(t,e,r,n){let i=t.slice(0,7),s=await hd(i,r,e,n,new Uint8Array(0));return{encryptedKey:s.ciphertext,iv:Ie(s.iv),tag:Ie(s.tag)}}o(sw,"wrap");function AS(t,e,r,n,i){if(i.crit!==void 0&&n?.crit===void 0)throw new t('"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(u=>typeof u!="string"||u.length===0))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;r!==void 0?s=new Map([...Object.entries(r),...e.entries()]):s=e;for(let u of n.crit){if(!s.has(u))throw new pe(`Extension Header Parameter "${u}" is not recognized`);if(i[u]===void 0)throw new t(`Extension Header Parameter "${u}" is missing`);if(s.get(u)&&n[u]===void 0)throw new t(`Extension Header Parameter "${u}" MUST be integrity protected`)}return new Set(n.crit)}o(AS,"validateCrit");var Oo=AS;var SS=o((t,e)=>{if(e!==void 0&&(!Array.isArray(e)||e.some(r=>typeof r!="string")))throw new TypeError(`"${t}" option must be an array of strings`);if(e)return new Set(e)},"validateAlgorithms"),uw=SS;var aw=Symbol();var kS=o(async t=>{if(t instanceof Uint8Array)return{kty:"oct",k:Ie(t)};if(!Me(t))throw new TypeError(Fe(t,...qe,"Uint8Array"));if(!t.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:e,key_ops:r,alg:n,use:i,...s}=await ee.subtle.exportKey("jwk",t);return s},"keyToJWK"),cw=kS;async function fw(t){return cw(t)}o(fw,"exportJWK");async function CS(t,e,r,n,i={}){let s,u,a;switch(ow(t,r,"encrypt"),r=await Wa.normalizePublicKey?.(r,t)||r,t){case"dir":{a=r;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!W1(r))throw new pe("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:c,apv:d}=i,{epk:p}=i;p||(p=(await L1(r)).privateKey);let{x:y,y:v,crv:x,kty:A}=await fw(p),B=await H1(r,p,t==="ECDH-ES"?e:t,t==="ECDH-ES"?kh(e):parseInt(t.slice(-5,-2),10),c,d);if(u={epk:{x:y,crv:x,kty:A}},A==="EC"&&(u.epk.y=v),c&&(u.apu=Ie(c)),d&&(u.apv=Ie(d)),t==="ECDH-ES"){a=B;break}a=n||To(e);let I=t.slice(-6);s=await La(I,B,a);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{a=n||To(e),s=await K1(t,r,a);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{a=n||To(e);let{p2c:c,p2s:d}=i;({encryptedKey:s,...u}=await F1(t,r,a,c,d));break}case"A128KW":case"A192KW":case"A256KW":{a=n||To(e),s=await La(t,r,a);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{a=n||To(e);let{iv:c}=i;({encryptedKey:s,...u}=await sw(t,r,a,c));break}default:throw new pe('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:a,encryptedKey:s,parameters:u}}o(CS,"encryptKeyManagement");var dw=CS;var Eh=class Eh{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,r){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new lt("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!ko(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new lt("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Oo(lt,new Map,r?.crit,this._protectedHeader,n),n.zip!==void 0)throw new pe('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:i,enc:s}=n;if(typeof i!="string"||!i)throw new lt('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof s!="string"||!s)throw new lt('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let u;if(this._cek&&(i==="dir"||i==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${i}`);let a;{let B;({cek:a,encryptedKey:u,parameters:B}=await dw(i,s,e,this._cek,this._keyManagementParameters)),B&&(r&&aw in r?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...B}:this.setUnprotectedHeader(B):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...B}:this.setProtectedHeader(B))}let c,d,p;this._protectedHeader?d=Te.encode(Ie(JSON.stringify(this._protectedHeader))):d=Te.encode(""),this._aad?(p=Ie(this._aad),c=Ft(d,Te.encode("."),Te.encode(p))):c=d;let{ciphertext:y,tag:v,iv:x}=await hd(s,this._plaintext,a,this._iv,c),A={ciphertext:Ie(y)};return x&&(A.iv=Ie(x)),v&&(A.tag=Ie(v)),u&&(A.encrypted_key=Ie(u)),p&&(A.aad=p),this._protectedHeader&&(A.protected=Ge.decode(d)),this._sharedUnprotectedHeader&&(A.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(A.header=this._unprotectedHeader),A}};o(Eh,"FlattenedEncrypt");var yd=Eh;function Ka(t,e){let r=`SHA-${t.slice(-3)}`;switch(t){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:t.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:e.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:e.name};default:throw new pe(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}o(Ka,"subtleDsa");async function Ja(t,e,r){if(r==="sign"&&(e=await Wa.normalizePrivateKey(e,t)),r==="verify"&&(e=await Wa.normalizePublicKey(e,t)),Me(e))return $1(e,t,r),e;if(e instanceof Uint8Array){if(!t.startsWith("HS"))throw new TypeError(Fe(e,...qe));return ee.subtle.importKey("raw",e,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Fe(e,...qe,"Uint8Array","JSON Web Key"))}o(Ja,"getCryptoKey");var ES=o(async(t,e,r,n)=>{let i=await Ja(t,e,"verify");Co(t,i);let s=Ka(t,i.algorithm);try{return await ee.subtle.verify(s,i,r,n)}catch{return!1}},"verify"),lw=ES;async function pw(t,e,r){if(!nt(t))throw new me("Flattened JWS must be an object");if(t.protected===void 0&&t.header===void 0)throw new me('Flattened JWS must have either of the "protected" or "header" members');if(t.protected!==void 0&&typeof t.protected!="string")throw new me("JWS Protected Header incorrect type");if(t.payload===void 0)throw new me("JWS Payload missing");if(typeof t.signature!="string")throw new me("JWS Signature missing or incorrect type");if(t.header!==void 0&&!nt(t.header))throw new me("JWS Unprotected Header incorrect type");let n={};if(t.protected)try{let B=Kt(t.protected);n=JSON.parse(Ge.decode(B))}catch{throw new me("JWS Protected Header is invalid")}if(!ko(n,t.header))throw new me("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...n,...t.header},s=Oo(me,new Map([["b64",!0]]),r?.crit,n,i),u=!0;if(s.has("b64")&&(u=n.b64,typeof u!="boolean"))throw new me('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:a}=i;if(typeof a!="string"||!a)throw new me('JWS "alg" (Algorithm) Header Parameter missing or invalid');let c=r&&uw("algorithms",r.algorithms);if(c&&!c.has(a))throw new Va('"alg" (Algorithm) Header Parameter value not allowed');if(u){if(typeof t.payload!="string")throw new me("JWS Payload must be a string")}else if(typeof t.payload!="string"&&!(t.payload instanceof Uint8Array))throw new me("JWS Payload must be a string or an Uint8Array instance");let d=!1;typeof e=="function"?(e=await e(n,t),d=!0,Fa(a,e,"verify"),Gr(e)&&(e=await Xr(e,a))):Fa(a,e,"verify");let p=Ft(Te.encode(t.protected??""),Te.encode("."),typeof t.payload=="string"?Te.encode(t.payload):t.payload),y;try{y=Kt(t.signature)}catch{throw new me("Failed to base64url decode the signature")}if(!await lw(a,e,y,p))throw new Ha;let x;if(u)try{x=Kt(t.payload)}catch{throw new me("Failed to base64url decode the payload")}else typeof t.payload=="string"?x=Te.encode(t.payload):x=t.payload;let A={payload:x};return t.protected!==void 0&&(A.protectedHeader=n),t.header!==void 0&&(A.unprotectedHeader=t.header),d?{...A,key:e}:A}o(pw,"flattenedVerify");async function hw(t,e,r){if(t instanceof Uint8Array&&(t=Ge.decode(t)),typeof t!="string")throw new me("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:s,length:u}=t.split(".");if(u!==3)throw new me("Invalid Compact JWS");let a=await pw({payload:i,protected:n,signature:s},e,r),c={payload:a.payload,protectedHeader:a.protectedHeader};return typeof e=="function"?{...c,key:a.key}:c}o(hw,"compactVerify");var Cr=o(t=>Math.floor(t.getTime()/1e3),"default");var PS=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,pi=o(t=>{let e=PS.exec(t);if(!e||e[4]&&e[1])throw new TypeError("Invalid time period format");let r=parseFloat(e[2]),n=e[3].toLowerCase(),i;switch(n){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(r*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(r*3600);break;case"day":case"days":case"d":i=Math.round(r*86400);break;case"week":case"weeks":case"w":i=Math.round(r*604800);break;default:i=Math.round(r*31557600);break}return e[1]==="-"||e[4]==="ago"?-i:i},"default");var yw=o(t=>t.toLowerCase().replace(/^application\//,""),"normalizeTyp"),TS=o((t,e)=>typeof t=="string"?e.includes(t):Array.isArray(t)?e.some(Set.prototype.has.bind(new Set(t))):!1,"checkAudiencePresence"),mw=o((t,e,r={})=>{let n;try{n=JSON.parse(Ge.decode(e))}catch{}if(!nt(n))throw new Ze("JWT Claims Set must be a top-level JSON object");let{typ:i}=r;if(i&&(typeof t.typ!="string"||yw(t.typ)!==yw(i)))throw new At('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:s=[],issuer:u,subject:a,audience:c,maxTokenAge:d}=r,p=[...s];d!==void 0&&p.push("iat"),c!==void 0&&p.push("aud"),a!==void 0&&p.push("sub"),u!==void 0&&p.push("iss");for(let A of new Set(p.reverse()))if(!(A in n))throw new At(`missing required "${A}" claim`,n,A,"missing");if(u&&!(Array.isArray(u)?u:[u]).includes(n.iss))throw new At('unexpected "iss" claim value',n,"iss","check_failed");if(a&&n.sub!==a)throw new At('unexpected "sub" claim value',n,"sub","check_failed");if(c&&!TS(n.aud,typeof c=="string"?[c]:c))throw new At('unexpected "aud" claim value',n,"aud","check_failed");let y;switch(typeof r.clockTolerance){case"string":y=pi(r.clockTolerance);break;case"number":y=r.clockTolerance;break;case"undefined":y=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:v}=r,x=Cr(v||new Date);if((n.iat!==void 0||d)&&typeof n.iat!="number")throw new At('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new At('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>x+y)throw new At('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new At('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=x-y)throw new Ao('"exp" claim timestamp check failed',n,"exp","check_failed")}if(d){let A=x-n.iat,B=typeof d=="number"?d:pi(d);if(A-y>B)throw new Ao('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(A<0-y)throw new At('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n},"default");async function za(t,e,r){let n=await hw(t,e,r);if(n.protectedHeader.crit?.includes("b64")&&n.protectedHeader.b64===!1)throw new Ze("JWTs MUST NOT use unencoded payload");let s={payload:mw(n.protectedHeader,n.payload,r),protectedHeader:n.protectedHeader};return typeof e=="function"?{...s,key:n.key}:s}o(za,"jwtVerify");var Ph=class Ph{constructor(e){this._flattened=new yd(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,r){let n=await this._flattened.encrypt(e,r);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(".")}};o(Ph,"CompactEncrypt");var Ga=Ph;var IS=o(async(t,e,r)=>{let n=await Ja(t,e,"sign");Co(t,n);let i=await ee.subtle.sign(Ka(t,n.algorithm),n,r);return new Uint8Array(i)},"sign"),gw=IS;var Th=class Th{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,r){if(!this._protectedHeader&&!this._unprotectedHeader)throw new me("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!ko(this._protectedHeader,this._unprotectedHeader))throw new me("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this._protectedHeader,...this._unprotectedHeader},i=Oo(me,new Map([["b64",!0]]),r?.crit,this._protectedHeader,n),s=!0;if(i.has("b64")&&(s=this._protectedHeader.b64,typeof s!="boolean"))throw new me('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:u}=n;if(typeof u!="string"||!u)throw new me('JWS "alg" (Algorithm) Header Parameter missing or invalid');Fa(u,e,"sign");let a=this._payload;s&&(a=Te.encode(Ie(a)));let c;this._protectedHeader?c=Te.encode(Ie(JSON.stringify(this._protectedHeader))):c=Te.encode("");let d=Ft(c,Te.encode("."),a),p=await gw(u,e,d),y={signature:Ie(p),payload:""};return s&&(y.payload=Ge.decode(a)),this._unprotectedHeader&&(y.header=this._unprotectedHeader),this._protectedHeader&&(y.protected=Ge.decode(c)),y}};o(Th,"FlattenedSign");var md=Th;var Ih=class Ih{constructor(e){this._flattened=new md(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,r){let n=await this._flattened.sign(e,r);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}`}};o(Ih,"CompactSign");var gd=Ih;function hi(t,e){if(!Number.isFinite(e))throw new TypeError(`Invalid ${t} input`);return e}o(hi,"validateInput");var Oh=class Oh{constructor(e={}){if(!nt(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:hi("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:hi("setNotBefore",Cr(e))}:this._payload={...this._payload,nbf:Cr(new Date)+pi(e)},this}setExpirationTime(e){return typeof e=="number"?this._payload={...this._payload,exp:hi("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:hi("setExpirationTime",Cr(e))}:this._payload={...this._payload,exp:Cr(new Date)+pi(e)},this}setIssuedAt(e){return typeof e>"u"?this._payload={...this._payload,iat:Cr(new Date)}:e instanceof Date?this._payload={...this._payload,iat:hi("setIssuedAt",Cr(e))}:typeof e=="string"?this._payload={...this._payload,iat:hi("setIssuedAt",Cr(new Date)+pi(e))}:this._payload={...this._payload,iat:hi("setIssuedAt",e)},this}};o(Oh,"ProduceJWT");var vd=Oh;var Rh=class Rh extends vd{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,r){let n=new gd(Te.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 Ze("JWTs MUST NOT use unencoded payload");return n.sign(e,r)}};o(Rh,"SignJWT");var Xa=Rh;var bd=Kt;function jh(t){let e;if(typeof t=="string"){let r=t.split(".");(r.length===3||r.length===5)&&([e]=r)}else if(typeof t=="object"&&t)if("protected"in t)e=t.protected;else throw new TypeError("Token does not contain a Protected Header");try{if(typeof e!="string"||!e)throw new Error;let r=JSON.parse(Ge.decode(bd(e)));if(!nt(r))throw new Error;return r}catch{throw new TypeError("Invalid Token or Protected Header formatting")}}o(jh,"decodeProtectedHeader");function Nh(t){if(typeof t!="string")throw new Ze("JWTs must use Compact JWS serialization, JWT must be a string");let{1:e,length:r}=t.split(".");if(r===5)throw new Ze("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Ze("Invalid JWT");if(!e)throw new Ze("JWTs must contain a payload");let n;try{n=bd(e)}catch{throw new Ze("Failed to base64url decode the payload")}let i;try{i=JSON.parse(Ge.decode(n))}catch{throw new Ze("Failed to parse the decoded payload as JSON")}if(!nt(i))throw new Ze("Invalid JWT Claims Set");return i}o(Nh,"decodeJwt");var vw="openid4vci-proof+jwt",Za=o(async t=>{let{signer:e,audience:r,nonce:n,clientId:i}=t,s=t.now??(()=>Math.floor(Date.now()/1e3));if(typeof r!="string"||r.length===0)throw new N("proof_signing_failed","Proof JWT `audience` must be a non-empty string");let u={alg:e.alg,kid:e.kid,typ:vw},a={aud:r,iat:s()};typeof n=="string"&&n.length>0&&(a.nonce=n),typeof i=="string"&&i.length>0&&(a.iss=i);try{return await e.sign(u,a)}catch(c){throw new N("proof_signing_failed",`Failed to sign proof JWT: ${c instanceof Error?c.message:String(c)}`,{cause:c})}},"buildProofJwt"),wd=o(async t=>{let{keypair:e,kid:r}=t;if(e.kty!=="OKP"||e.crv!=="Ed25519")throw new N("proof_signing_failed",`createJoseEd25519Signer only supports Ed25519 OKP keys (got kty=${e.kty}, crv=${e.crv})`);let n=await Xr({kty:e.kty,crv:e.crv,x:e.x,d:e.d},"EdDSA");return{alg:"EdDSA",kid:r,sign:o(async(i,s)=>new Xa(s).setProtectedHeader({...i,alg:"EdDSA"}).sign(n),"sign")}},"createJoseEd25519Signer");var Qa=o(async t=>{let{credentialEndpoint:e,accessToken:r,tokenType:n="Bearer",credentialIdentifier:i,format:s,proofJwt:u,extra:a}=t,c=t.fetchImpl??globalThis.fetch;if(typeof c!="function")throw new N("credential_request_failed","No fetch implementation available for credential request");let d=typeof i=="string"&&i.length>0,p=typeof s=="string"&&s.length>0;if(!d&&!p)throw new N("credential_request_failed","requestCredential requires either `credentialIdentifier` (from authorization_details) or `format`");let y={proof:{proof_type:"jwt",jwt:u}};d?y.credential_identifier=i:(y.format=s,a&&Object.assign(y,a));let v;try{v=await c(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`${n} ${r}`},body:JSON.stringify(y)})}catch(A){throw new N("credential_request_failed",`Credential endpoint ${e} unreachable: ${A instanceof Error?A.message:String(A)}`,{cause:A})}let x;try{x=await v.json()}catch(A){throw new N("credential_response_invalid",`Credential endpoint ${e} returned non-JSON body`,{status:v.status,cause:A})}if(!v.ok){let A=x,B=typeof A?.error=="string"?A.error:"unknown",I=typeof A?.error_description=="string"?`: ${A.error_description}`:"";throw new N("credential_request_failed",`Credential endpoint returned ${v.status} (${B})${I}`,{status:v.status,body:x})}if(typeof x!="object"||x===null)throw new N("credential_response_invalid","Credential endpoint response was not a JSON object",{status:v.status,body:x});return x},"requestCredential");var _d=o(async t=>{let{offer:e,signer:r}=t,n=t.options??{},i=t.fetchImpl??globalThis.fetch,s=e.grants?.[Tn];if(!s)throw new N("unsupported_grant","acceptCredentialOffer currently only handles the pre-authorized_code grant. For authorization_code flows, use slice-4 APIs (not yet shipped).");if(s.tx_code&&!n.txCode)throw new N("tx_code_required","Offer requires a transaction code but none was supplied in options.txCode");let u=n.configurationIds&&n.configurationIds.length>0?n.configurationIds.filter(J=>e.credential_configuration_ids.includes(J)):e.credential_configuration_ids;if(u.length===0)throw new N("unsupported_format","No credential configuration ids in the offer matched the caller-supplied filter");let a=await Ma(e.credential_issuer,i),c=$a(a,s.authorization_server),d=await Ua(c,i),p=await Gp({tokenEndpoint:d.token_endpoint,preAuthorizedCode:s["pre-authorized_code"],txCode:n.txCode,clientId:n.clientId,fetchImpl:i}),y=await Za({signer:r,audience:e.credential_issuer,nonce:p.c_nonce,clientId:n.clientId}),v=[],x,A=p.c_nonce,B=p.c_nonce_expires_in,I=BS(p.authorization_details);for(let J of u){let de=RS(a,J),fe=jS(de),ve=I.get(J)??[],Y=ve.length>0?ve.map(ye=>({credentialIdentifier:ye})):[{credentialIdentifier:void 0}];for(let ye of Y){let ae=await Qa({credentialEndpoint:a.credential_endpoint,accessToken:p.access_token,tokenType:p.token_type,credentialIdentifier:ye.credentialIdentifier,format:ye.credentialIdentifier?void 0:fe,extra:ye.credentialIdentifier?void 0:NS(de,fe),proofJwt:y,fetchImpl:i});if(!ae.credential&&!Array.isArray(ae.credentials))throw new N("unsupported_format","Credential endpoint returned neither `credential` nor `credentials`; deferred issuance not supported yet",{body:ae});if(ae.credential!==void 0&&v.push({format:fe,credential:ae.credential,configuration_id:J}),Array.isArray(ae.credentials))for(let Ne of ae.credentials)Ne&&typeof Ne=="object"&&"credential"in Ne&&v.push({format:fe,credential:Ne.credential,configuration_id:J});typeof ae.notification_id=="string"&&(x=ae.notification_id),typeof ae.c_nonce=="string"&&(A=ae.c_nonce,B=typeof ae.c_nonce_expires_in=="number"?ae.c_nonce_expires_in:void 0)}}return{credentials:v,notification_id:x,c_nonce:A,c_nonce_expires_in:B}},"acceptCredentialOffer"),RS=o((t,e)=>{let r=t.credential_configurations_supported;if(!r||typeof r!="object"||!(e in r))return;let n=r[e];if(!(!n||typeof n!="object"))return n},"getConfigurationDefinition"),jS=o(t=>t&&typeof t.format=="string"&&t.format.length>0?t.format:"jwt_vc_json","inferFormatFromDefinition"),NS=o((t,e)=>{if(t&&(e==="jwt_vc_json"||e==="jwt_vc_json-ld"||e==="ldp_vc")){let r=t.credential_definition;if(r&&typeof r=="object")return{credential_definition:r}}},"buildFormatSpecificBody"),BS=o(t=>{let e=new Map;if(!Array.isArray(t))return e;for(let r of t){if(!r||typeof r!="object")continue;let n=r,i=n.credential_configuration_id,s=n.credential_identifiers;if(typeof i!="string"||!Array.isArray(s))continue;let u=s.filter(a=>typeof a=="string");u.length>0&&e.set(i,u)}return e},"indexAuthorizationDetails");var qh=class qh extends Error{constructor(e,r){super(r),this.name="PkceError",this.code=e}};o(qh,"PkceError");var On=qh,Bh=o(async(t={})=>{let e=t.byteLength??32;if(e<24||e>96)throw new On("invalid_verifier",`PKCE byteLength must be between 24 and 96 (got ${e})`);let r=bw(qS(e)),n=await Dh(r);return{verifier:r,challenge:n,method:"S256"}},"generatePkcePair"),Dh=o(async t=>{if(typeof t!="string"||t.length<24)throw new On("invalid_verifier","PKCE verifier must be a base64url string with \u226524 chars");let e=new TextEncoder().encode(t),r=await MS().digest("SHA-256",e);return bw(new Uint8Array(r))},"computeS256Challenge"),DS=o(async t=>{let e=t.method??"S256";if(e!=="S256")throw new On("unsupported_method",`PKCE method ${e} not supported`);return await Dh(t.verifier)===t.challenge},"verifyPkce"),bw=o(t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},"toB64url"),qS=o(t=>{let e=new Uint8Array(t);return ww().getRandomValues(e),e},"getRandomBytes"),ww=o(()=>{let t=globalThis.crypto;if(!t)throw new On("invalid_verifier","Web Crypto API not available in this runtime");return t},"getCrypto"),MS=o(()=>{let t=ww().subtle;if(!t)throw new On("invalid_verifier","crypto.subtle not available in this runtime");return t},"getSubtle");var Mh="authorization_code",Uh=o(async t=>{let e=t.fetchImpl??globalThis.fetch;if(!t.clientId||t.clientId.length===0)throw new N("token_request_failed","beginAuthCodeFlow requires a non-empty `clientId` \u2014 the AS cannot track the request otherwise");if(!t.redirectUri||t.redirectUri.length===0)throw new N("token_request_failed","beginAuthCodeFlow requires a non-empty `redirectUri`");let r=t.offer.grants?.[Mh];if(!r)throw new N("unsupported_grant","Offer does not advertise the authorization_code grant. Use acceptCredentialOffer for pre-auth offers.");let n=$S(t.offer,t.configurationIds),i=await Ma(t.offer.credential_issuer,e),s=$a(i,r.authorization_server),u=await Ua(s,e);if(typeof u.authorization_endpoint!="string")throw new N("metadata_invalid","Authorization server metadata is missing `authorization_endpoint` \u2014 cannot run auth_code flow");let a=await Bh(),c=FS(),d=_w({authorizationEndpoint:u.authorization_endpoint,clientId:t.clientId,redirectUri:t.redirectUri,configurationIds:n,scope:t.scope,pkce:a,state:c,issuerState:typeof r.issuer_state=="string"?r.issuer_state:void 0}),p={version:1,issuer:t.offer.credential_issuer,tokenEndpoint:u.token_endpoint,credentialEndpoint:i.credential_endpoint,configurationIds:n,redirectUri:t.redirectUri,clientId:t.clientId,state:c,pkceVerifier:a.verifier,pkceMethod:a.method,credentialConfigurations:i.credential_configurations_supported??{}};return{authorizationUrl:d,flowHandle:p}},"beginAuthCodeFlow"),$h=o(async t=>{let{flowHandle:e,code:r,signer:n}=t,i=t.fetchImpl??globalThis.fetch;if(t.state&&t.state!==e.state)throw new N("token_request_failed",`State parameter mismatch (callback state=${t.state}, expected ${e.state})`);let s=await xw({tokenEndpoint:e.tokenEndpoint,code:r,codeVerifier:e.pkceVerifier,clientId:e.clientId,redirectUri:e.redirectUri,fetchImpl:i}),u=await Za({signer:n,audience:e.issuer,nonce:s.c_nonce,clientId:e.clientId});return US({flowHandle:e,tokenResponse:s,proofJwt:u,fetchImpl:i})},"completeAuthCodeFlow"),_w=o(t=>{let e=new URL(t.authorizationEndpoint);e.searchParams.set("response_type","code"),e.searchParams.set("client_id",t.clientId),e.searchParams.set("redirect_uri",t.redirectUri),e.searchParams.set("code_challenge",t.pkce.challenge),e.searchParams.set("code_challenge_method",t.pkce.method),e.searchParams.set("state",t.state);let r=t.configurationIds.map(n=>({type:"openid_credential",credential_configuration_id:n}));return e.searchParams.set("authorization_details",JSON.stringify(r)),t.scope&&e.searchParams.set("scope",t.scope),t.issuerState&&e.searchParams.set("issuer_state",t.issuerState),e.toString()},"buildAuthorizationUrl"),xw=o(async t=>{let{tokenEndpoint:e,code:r,codeVerifier:n,clientId:i,redirectUri:s}=t,u=t.fetchImpl??globalThis.fetch;if(typeof u!="function")throw new N("token_request_failed","No fetch implementation available for authorization_code token exchange");let a=new URLSearchParams;a.set("grant_type",Mh),a.set("code",r),a.set("code_verifier",n),a.set("client_id",i),a.set("redirect_uri",s);let c;try{c=await u(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:a.toString()})}catch(p){throw new N("token_request_failed",`Token endpoint ${e} unreachable: ${p instanceof Error?p.message:String(p)}`,{cause:p})}let d;try{d=await c.json()}catch(p){throw new N("token_response_invalid",`Token endpoint ${e} returned non-JSON body`,{status:c.status,cause:p})}if(!c.ok){let p=d,y=typeof p?.error=="string"?p.error:"unknown",v=typeof p?.error_description=="string"?`: ${p.error_description}`:"";throw new N("token_request_failed",`Token endpoint returned ${c.status} (${y})${v}`,{status:c.status,body:d})}if(!WS(d))throw new N("token_response_invalid","Token endpoint response is missing required `access_token` / `token_type`",{status:c.status,body:d});return d},"exchangeAuthorizationCode"),US=o(async t=>{let e=[],r,n=t.tokenResponse.c_nonce,i=t.tokenResponse.c_nonce_expires_in,s=LS(t.tokenResponse.authorization_details);for(let u of t.flowHandle.configurationIds){let a=t.flowHandle.credentialConfigurations[u],c=VS(a),d=s.get(u)??[],p=d.length>0?d.map(y=>({credentialIdentifier:y})):[{credentialIdentifier:void 0}];for(let y of p){let v=await Qa({credentialEndpoint:t.flowHandle.credentialEndpoint,accessToken:t.tokenResponse.access_token,tokenType:t.tokenResponse.token_type,credentialIdentifier:y.credentialIdentifier,format:y.credentialIdentifier?void 0:c,extra:y.credentialIdentifier?void 0:HS(a,c),proofJwt:t.proofJwt,fetchImpl:t.fetchImpl});if(!v.credential&&!Array.isArray(v.credentials))throw new N("unsupported_format","Credential endpoint returned neither `credential` nor `credentials`; deferred issuance not supported yet",{body:v});if(v.credential!==void 0&&e.push({format:c,credential:v.credential,configuration_id:u}),Array.isArray(v.credentials))for(let x of v.credentials)x&&typeof x=="object"&&"credential"in x&&e.push({format:c,credential:x.credential,configuration_id:u});typeof v.notification_id=="string"&&(r=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:r,c_nonce:n,c_nonce_expires_in:i}},"fetchCredentialsForToken"),$S=o((t,e)=>{let r=e&&e.length>0?e.filter(n=>t.credential_configuration_ids.includes(n)):t.credential_configuration_ids;if(r.length===0)throw new N("unsupported_format","No credential configuration ids matched the caller-supplied filter");return r},"filterConfigurationIds"),VS=o(t=>t&&typeof t=="object"&&typeof t.format=="string"?t.format:"jwt_vc_json","inferFormat"),HS=o((t,e)=>{if(!(!t||typeof t!="object")&&(e==="jwt_vc_json"||e==="jwt_vc_json-ld"||e==="ldp_vc")){let r=t.credential_definition;if(r&&typeof r=="object")return{credential_definition:r}}},"formatSpecificBody"),LS=o(t=>{let e=new Map;if(!Array.isArray(t))return e;for(let r of t){if(!r||typeof r!="object")continue;let n=r,i=n.credential_configuration_id,s=n.credential_identifiers;if(typeof i!="string"||!Array.isArray(s))continue;let u=s.filter(a=>typeof a=="string");u.length>0&&e.set(i,u)}return e},"indexAuthorizationDetails"),WS=o(t=>{if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.access_token=="string"&&e.access_token.length>0&&typeof e.token_type=="string"&&e.token_type.length>0},"isTokenResponse"),FS=o(()=>{let t=globalThis.crypto;if(!t)throw new Error("Web Crypto API not available in this runtime");let e=new Uint8Array(16);t.getRandomValues(e);let r="";for(let n=0;n<e.length;n++)r+=e[n].toString(16).padStart(2,"0");return r},"randomId");var Vh=o((t,e)=>{switch(e){case"jwt_vc_json":case"jwt_vc":case"jwt_vc_json-ld":return KS(t,e);case"ldp_vc":if(!Aw(t))throw new N("unsupported_format",`ldp_vc credential was not a JSON-LD object (received ${typeof t})`);return{vc:t,rawFormat:e};default:throw new N("unsupported_format",`Credential format "${e}" is not yet supported by the openid4vc plugin`)}},"normalizeIssuedCredential"),KS=o((t,e)=>{if(typeof t!="string")throw new N("unsupported_format",`${e} credential must be a compact JWS string (received ${typeof t})`);let r;try{r=Nh(t)}catch(p){throw new N("unsupported_format",`Failed to decode ${e} credential as a JWT: ${p instanceof Error?p.message:String(p)}`,{cause:p})}let n=r.vc;if(!Aw(n))throw new N("unsupported_format",`${e} credential JWT is missing the required \`vc\` claim`);let i={...n};if(typeof r.jti=="string"&&!i.id&&(i.id=r.jti),typeof r.iss=="string"&&!zS(i)&&(i.issuer=r.iss),typeof r.sub=="string")if(i.credentialSubject&&!Array.isArray(i.credentialSubject)){let p=i.credentialSubject;p.id||(p.id=r.sub)}else i.credentialSubject||(i.credentialSubject={id:r.sub});let s=typeof r.nbf=="number"?r.nbf:typeof r.iat=="number"?r.iat:void 0;s!==void 0&&!i.issuanceDate&&!i.validFrom&&(i.issuanceDate=new Date(s*1e3).toISOString()),typeof r.exp=="number"&&!i.expirationDate&&!i.validUntil&&(i.expirationDate=new Date(r.exp*1e3).toISOString());let u=i.issuanceDate??(typeof i.validFrom=="string"?i.validFrom:void 0)??new Date().toISOString(),a=JS(i.issuer)??(typeof r.iss=="string"?r.iss:void 0),c;try{let p=jh(t);typeof p?.kid=="string"&&p.kid.length>0&&(c=p.kid)}catch{}let d=c?c.startsWith("#")&&a?`${a}${c}`:c:a?`${a}#0`:"urn:openid4vci:unknown-verification-method";return i.proof={type:"JwtProof2020",created:u,proofPurpose:"assertionMethod",verificationMethod:d,jwt:t},{vc:i,rawFormat:e,jwt:t}},"decodeJwtVc"),JS=o(t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"){let e=t.id;if(typeof e=="string"&&e.length>0)return e}},"pickIssuerId"),Aw=o(t=>{if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=t;return"@context"in e||"type"in e||"credentialSubject"in e},"isVcObject"),zS=o(t=>t.issuer?typeof t.issuer=="string"?t.issuer.length>0:typeof t.issuer=="object"&&t.issuer!==null?typeof t.issuer.id=="string"&&t.issuer.id.length>0:!1:!1,"hasIssuer");var Sw="LearnCloud",Hh=o(async(t,e,r={})=>{let n=r.storage??Sw,i=r.encrypt??!0,s=r.makeId??s5,u=r.upload??r5(t,n,i),a=r.addToIndex??n5(t,n),c=[],d=[];for(let p=0;p<e.credentials.length;p++){let y=e.credentials[p];try{let v=Vh(y.credential,y.format),x=await i5(u,v.vc),A=s(),B={id:A,uri:x,category:GS(r.category,v.vc,p),...xd(r.title,v.vc,p)&&{title:xd(r.title,v.vc,p)},...xd(r.imgUrl,v.vc,p)&&{imgUrl:xd(r.imgUrl,v.vc,p)},__v:1};await o5(a,B),c.push({uri:x,recordId:A,vc:v.vc,configurationId:y.configuration_id,format:v.rawFormat})}catch(v){d.push({configurationId:y.configuration_id,format:y.format,error:v instanceof N?v:new N("store_failed",`Unexpected error while storing credential: ${v instanceof Error?v.message:String(v)}`,{cause:v})})}}return{stored:c,failures:d}},"storeAcceptedCredentials"),GS=o((t,e,r)=>typeof t=="string"?t:typeof t=="function"?t(e,r):XS(e),"resolveCategory"),xd=o((t,e,r)=>{if(typeof t=="string")return t;if(typeof t=="function")return t(e,r)},"resolveOptional"),XS=o(t=>{let e=t5(t.type);return e.some(Ad(ZS))?"ID":e.some(Ad(QS))?"Achievement":e.some(Ad(YS))?"Work":e.some(Ad(e5))?"Learning History":"Achievement"},"defaultCategoryFor"),ZS=["IdentityCredential","VerifiableId","MobileDriversLicense"],QS=["OpenBadgeCredential","AchievementCredential","UniversityDegreeCredential","MicroCredential"],YS=["EmploymentCredential","WorkExperienceCredential"],e5=["CourseCompletionCredential","LearningHistoryCredential"],Ad=o(t=>e=>t.includes(e),"matchesAny"),t5=o(t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):typeof t=="string"?[t]:[],"toTypeArray"),r5=o((t,e,r)=>{let i=t.store?.[e];if(!i)throw new N("store_plane_missing",`LearnCard has no store plugin named "${e}" \u2014 did you forget to add @learncard/learn-cloud-plugin?`);if(r&&typeof i.uploadEncrypted=="function")return s=>i.uploadEncrypted(s);if(typeof i.upload=="function")return s=>i.upload(s);throw new N("store_plane_missing",`Store plugin "${e}" implements neither \`upload\` nor \`uploadEncrypted\``)},"resolveUpload"),n5=o((t,e)=>{let n=t.index?.[e];if(!n||typeof n.add!="function")throw new N("index_plane_missing",`LearnCard has no index plugin named "${e}" exposing an \`add\` method`);return i=>n.add(i)},"resolveAddToIndex"),i5=o(async(t,e)=>{let r;try{r=await t(e)}catch(n){throw new N("store_failed",`Store plane rejected the credential upload: ${n instanceof Error?n.message:String(n)}`,{cause:n})}if(typeof r!="string"||r.length===0)throw new N("store_failed","Store plane upload returned an empty URI \u2014 refusing to index an unresolvable credential");return r},"safeUpload"),o5=o(async(t,e)=>{try{await t(e)}catch(r){throw new N("index_failed",`Index plane rejected the credential record: ${r instanceof Error?r.message:String(r)}`,{cause:r})}},"safeAddToIndex"),s5=o(()=>{let t=globalThis.crypto;if(t&&typeof t.randomUUID=="function")return t.randomUUID();let e=new Uint8Array(16),r=globalThis.crypto;if(r&&typeof r.getRandomValues=="function")r.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");var Lh=class Lh extends Error{constructor(e,r,n){super(r),this.name="VpError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}};o(Lh,"VpError");var te=Lh;var fZ=kr(Cw());var Ir={};E1(Ir,{Any:()=>Pr,BaseBlock:()=>Ue,BaseStringBlock:()=>nc,BitString:()=>dr,BmpString:()=>bi,Boolean:()=>mi,CharacterString:()=>Pi,Choice:()=>No,Constructed:()=>$e,DATE:()=>cc,DateTime:()=>dc,Duration:()=>lc,EndOfContent:()=>ic,Enumerated:()=>gi,GeneralString:()=>Ei,GeneralizedTime:()=>Ti,GraphicString:()=>Ci,HexBlock:()=>Tr,IA5String:()=>ki,Integer:()=>rn,Null:()=>cr,NumericString:()=>_i,ObjectIdentifier:()=>vi,OctetString:()=>fr,Primitive:()=>tn,PrintableString:()=>xi,RawData:()=>Gh,RelativeObjectIdentifier:()=>ac,Repeated:()=>Ii,Sequence:()=>it,Set:()=>pt,TIME:()=>pc,TeletexString:()=>Ai,TimeOfDay:()=>fc,UTCTime:()=>Bn,UniversalString:()=>wi,Utf8String:()=>zt,ValueBlock:()=>Qe,VideotexString:()=>Si,ViewWriter:()=>jo,VisibleString:()=>Nn,compareSchema:()=>Yr,fromBER:()=>on,verifySchema:()=>E5});var re=kr(Qr());function yi(t,e){let r=0;if(t.length===1)return t[0];for(let n=t.length-1;n>=0;n--)r+=t[t.length-1-n]*Math.pow(2,e*n);return r}o(yi,"utilFromBase");function jn(t,e,r=-1){let n=r,i=t,s=0,u=Math.pow(2,e);for(let a=1;a<8;a++){if(t<u){let c;if(n<0)c=new ArrayBuffer(a),s=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}let d=new Uint8Array(c);for(let p=a-1;p>=0;p--){let y=Math.pow(2,p*e);d[s-p-1]=Math.floor(i/y),i-=d[s-p-1]*y}return c}u*=Math.pow(2,e)}return new ArrayBuffer(0)}o(jn,"utilToBase");function Cd(...t){let e=0,r=0;for(let s of t)e+=s.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of t)i.set(s,r),r+=s.length;return i}o(Cd,"utilConcatView");function Jh(){let t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=t[0]===255&&t[1]&128,c=t[0]===0&&(t[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)r[a]=0;r[0]=t[0]&128;let n=yi(r,8),i=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(i);for(let a=0;a<this.valueHex.byteLength;a++)s[a]=t[a];return s[0]&=127,yi(s,8)-n}o(Jh,"utilDecodeTC");function Ew(t){let e=t<0?t*-1:t,r=128;for(let n=1;n<8;n++){if(e<=r){if(t<0){let u=r-e,a=jn(u,8,n),c=new Uint8Array(a);return c[0]|=128,a}let i=jn(e,8,n),s=new Uint8Array(i);if(s[0]&128){let u=i.slice(0),a=new Uint8Array(u);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let c=0;c<u.byteLength;c++)s[c+1]=a[c];s[0]=0}return i}r*=Math.pow(2,8)}return new ArrayBuffer(0)}o(Ew,"utilEncodeTC");function Pw(t,e){if(t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let i=0;i<r.length;i++)if(r[i]!==n[i])return!1;return!0}o(Pw,"isEqualBuffer");function St(t,e){let r=t.toString(10);if(e<r.length)return"";let n=e-r.length,i=new Array(n);for(let u=0;u<n;u++)i[u]="0";return i.join("").concat(r)}o(St,"padNumber");var Ij=Math.log(2);function Ed(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(Ed,"assertBigInt");function Xh(t){let e=0,r=0;for(let i=0;i<t.length;i++){let s=t[i];e+=s.byteLength}let n=new Uint8Array(e);for(let i=0;i<t.length;i++){let s=t[i];n.set(new Uint8Array(s),r),r+=s.byteLength}return n.buffer}o(Xh,"concat");function nn(t,e,r,n){return e instanceof Uint8Array?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",!1):n<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-n<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(nn,"checkBufferParams");var Qh=class Qh{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Xh(this.items)}};o(Qh,"ViewWriter");var jo=Qh,ec=[new Uint8Array([1])],Tw="0123456789",zh="name",Iw="valueHexView",y5="isHexOnly",m5="idBlock",g5="tagClass",v5="tagNumber",b5="isConstructed",w5="fromBER",_5="toBER",x5="local",kt="",lr=new ArrayBuffer(0),Hd=new Uint8Array(0),rc="EndOfContent",Rw="OCTET STRING",jw="BIT STRING";function Tr(t){var r;var e;return e=(r=class extends t{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var s;super(...i);let u=i[0]||{};this.isHexOnly=(s=u.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=u.valueHex?re.BufferSourceConverter.toUint8Array(u.valueHex):Hd}fromBER(i,s,u){let a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!nn(this,a,s,u))return-1;let c=s+u;return this.valueHexView=a.subarray(s,c),this.valueHexView.length?(this.blockLength=u,c):(this.warnings.push("Zero buffer length"),s)}toBER(i=!1){return this.isHexOnly?i?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",lr)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:re.Convert.ToHex(this.valueHexView)}}},o(r,"Some"),r),e.NAME="hexBlock",e}o(Tr,"HexBlock");var Yh=class Yh{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:r=kt,warnings:n=[],valueBeforeDecode:i=Hd}={}){this.blockLength=e,this.error=r,this.warnings=n,this.valueBeforeDecodeView=re.BufferSourceConverter.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:re.Convert.ToHex(this.valueBeforeDecodeView)}}};o(Yh,"LocalBaseBlock");var en=Yh;en.NAME="baseBlock";var ey=class ey extends en{fromBER(e,r,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};o(ey,"ValueBlock");var Qe=ey;Qe.NAME="valueBlock";var ty=class ty extends Tr(en){constructor({idBlock:e={}}={}){var r,n,i,s;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=e.valueHex?re.BufferSourceConverter.toUint8Array(e.valueHex):Hd,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",lr}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,r|=s,i[0]=r}return i.buffer}if(!this.isHexOnly){let i=jn(this.tagNumber,7),s=new Uint8Array(i),u=i.byteLength,a=new Uint8Array(u+1);if(a[0]=r|31,!e){for(let c=0;c<u-1;c++)a[c+1]=s[c]|128;a[u]=s[u-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=r|31,!e){let i=this.valueHexView;for(let s=0;s<i.length-1;s++)n[s+1]=i[s]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,r,n){let i=re.BufferSourceConverter.toUint8Array(e);if(!nn(this,i,r,n))return-1;let s=i.subarray(r,r+n);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[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=(s[0]&32)===32,this.isHexOnly=!1;let a=s[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=1,d=this.valueHexView=new Uint8Array(255),p=255;for(;s[c]&128;){if(d[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===p){p+=255;let v=new Uint8Array(p);for(let x=0;x<d.length;x++)v[x]=d[x];d=this.valueHexView=new Uint8Array(p)}}this.blockLength=c+1,d[c-1]=s[c]&127;let y=new Uint8Array(c);for(let v=0;v<c;v++)y[v]=d[v];d=this.valueHexView=new Uint8Array(c),d.set(y),this.blockLength<=9?this.tagNumber=yi(d,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 r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};o(ty,"LocalIdentificationBlock");var Pd=ty;Pd.NAME="identificationBlock";var ry=class ry extends en{constructor({lenBlock:e={}}={}){var r,n,i;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:!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,r,n){let i=re.BufferSourceConverter.toUint8Array(e);if(!nn(this,i,r,n))return-1;let s=i.subarray(r,r+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;let u=s[0]&127;if(u>8)return this.error="Too big integer",-1;if(u+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let a=r+1,c=i.subarray(a,a+u);return c[u-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=yi(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=u+1,r+this.blockLength}toBER(e=!1){let r,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(r),n[0]=128),r;if(this.longFormUsed){let i=jn(this.length,8);if(i.byteLength>127)return this.error="Too big length",lr;if(r=new ArrayBuffer(i.byteLength+1),e)return r;let s=new Uint8Array(i);n=new Uint8Array(r),n[0]=i.byteLength|128;for(let u=0;u<i.byteLength;u++)n[u+1]=s[u];return r}return r=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(r),n[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};o(ry,"LocalLengthBlock");var Td=ry;Td.NAME="lengthBlock";var R={},ny=class ny extends en{constructor({name:e=kt,optional:r=!1,primitiveSchema:n,...i}={},s){super(i),this.name=e,this.optional=r,n&&(this.primitiveSchema=n),this.idBlock=new Pd(i),this.lenBlock=new Td(i),this.valueBlock=s?new s(i):new Qe(i)}fromBER(e,r,n){let i=this.valueBlock.fromBER(e,r,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,r){let n=r||new jo;r||Nw(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 s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let u=this.lenBlock.toBER(e);n.write(u),n.write(s)}return r?lr: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():re.Convert.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,r=re.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${r}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let r=this.toBER(),n=e.toBER();return Pw(r,n)}};o(ny,"BaseBlock");var Ue=ny;Ue.NAME="BaseBlock";function Nw(t){var e;if(t instanceof R.Constructed)for(let r of t.valueBlock.value)Nw(r)&&(t.lenBlock.isIndefiniteForm=!0);return!!(!((e=t.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(Nw,"prepareIndefiniteForm");var iy=class iy extends Ue{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=kt,...r}={},n){super(r,n),e&&this.fromString(e)}fromBER(e,r,n){let i=this.valueBlock.fromBER(e,r,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}'`}};o(iy,"BaseStringBlock");var nc=iy;nc.NAME="BaseStringBlock";var oy=class oy extends Tr(Qe){constructor({isHexOnly:e=!0,...r}={}){super(r),this.isHexOnly=e}};o(oy,"LocalPrimitiveValueBlock");var Id=oy;Id.NAME="PrimitiveValueBlock";var Bw,sy=class sy extends Ue{constructor(e={}){super(e,Id),this.idBlock.isConstructed=!1}};o(sy,"Primitive");var tn=sy;Bw=tn;R.Primitive=Bw;tn.NAME="PRIMITIVE";function A5(t,e){if(t instanceof e)return t;let r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}o(A5,"localChangeType");function Bo(t,e=0,r=t.length){let n=e,i=new Ue({},Qe),s=new en;if(!nn(s,t,e,r))return i.error=s.error,{offset:-1,result:i};if(!t.subarray(e,e+r).length)return i.error="Zero buffer length",{offset:-1,result:i};let a=i.idBlock.fromBER(t,e,r);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),a===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=a,r-=i.idBlock.blockLength,a=i.lenBlock.fromBER(t,e,r),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),a===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=a,r-=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 c=Ue;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};c=R.EndOfContent;break;case 1:c=R.Boolean;break;case 2:c=R.Integer;break;case 3:c=R.BitString;break;case 4:c=R.OctetString;break;case 5:c=R.Null;break;case 6:c=R.ObjectIdentifier;break;case 10:c=R.Enumerated;break;case 12:c=R.Utf8String;break;case 13:c=R.RelativeObjectIdentifier;break;case 14:c=R.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:c=R.Sequence;break;case 17:c=R.Set;break;case 18:c=R.NumericString;break;case 19:c=R.PrintableString;break;case 20:c=R.TeletexString;break;case 21:c=R.VideotexString;break;case 22:c=R.IA5String;break;case 23:c=R.UTCTime;break;case 24:c=R.GeneralizedTime;break;case 25:c=R.GraphicString;break;case 26:c=R.VisibleString;break;case 27:c=R.GeneralString;break;case 28:c=R.UniversalString;break;case 29:c=R.CharacterString;break;case 30:c=R.BmpString;break;case 31:c=R.DATE;break;case 32:c=R.TimeOfDay;break;case 33:c=R.DateTime;break;case 34:c=R.Duration;break;default:{let d=i.idBlock.isConstructed?new R.Constructed:new R.Primitive;d.idBlock=i.idBlock,d.lenBlock=i.lenBlock,d.warnings=i.warnings,i=d}}break;default:c=i.idBlock.isConstructed?R.Constructed:R.Primitive}return i=A5(i,c),a=i.fromBER(t,e,i.lenBlock.isIndefiniteForm?r:i.lenBlock.length),i.valueBeforeDecodeView=t.subarray(n,n+i.blockLength),{offset:a,result:i}}o(Bo,"localFromBER");function on(t){if(!t.byteLength){let e=new Ue({},Qe);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Bo(re.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength)}o(on,"fromBER");function S5(t,e){return t?1:e}o(S5,"checkLen");var uy=class uy extends Qe{constructor({value:e=[],isIndefiniteForm:r=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=r}fromBER(e,r,n){let i=re.BufferSourceConverter.toUint8Array(e);if(!nn(this,i,r,n))return-1;if(this.valueBeforeDecodeView=i.subarray(r,r+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;S5(this.isIndefiniteForm,n)>0;){let u=Bo(i,s,n);if(u.offset===-1)return this.error=u.result.error,this.warnings.concat(u.result.warnings),-1;if(s=u.offset,this.blockLength+=u.result.blockLength,n-=u.result.blockLength,this.value.push(u.result),this.isIndefiniteForm&&u.result.constructor.NAME===rc)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===rc?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,r){let n=r||new jo;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return r?lr:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let r of this.value)e.value.push(r.toJSON());return e}};o(uy,"LocalConstructedValueBlock");var Er=uy;Er.NAME="ConstructedValueBlock";var Dw,ay=class ay extends Ue{constructor(e={}){super(e,Er),this.idBlock.isConstructed=!0}fromBER(e,r,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,r,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(`
|
|
10
|
+
-----END ${e}-----`},"default");var ti=o((t,e,r=0)=>{r===0&&(e.unshift(e.length),e.unshift(6));let n=t.indexOf(e[0],r);if(n===-1)return!1;let i=t.subarray(n,n+e.length);return i.length!==e.length?!1:i.every((s,u)=>s===e[u])||ti(t,e,n+1)},"findOid"),Iw=o(t=>{switch(!0){case ti(t,[42,134,72,206,61,3,1,7]):return"P-256";case ti(t,[43,129,4,0,34]):return"P-384";case ti(t,[43,129,4,0,35]):return"P-521";case ti(t,[43,101,110]):return"X25519";case ti(t,[43,101,111]):return"X448";case ti(t,[43,101,112]):return"Ed25519";case ti(t,[43,101,113]):return"Ed448";default:throw new ye("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},"getNamedCurve"),e5=o(async(t,e,r,n,i)=>{let s,u,a=new Uint8Array(atob(r.replace(t,"")).split("").map(d=>d.charCodeAt(0))),c=e==="spki";switch(n){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},u=c?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},u=c?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},u=c?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},u=c?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},u=c?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},u=c?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let d=Iw(a);s=d.startsWith("P-")?{name:"ECDH",namedCurve:d}:{name:d},u=c?[]:["deriveBits"];break}case"Ed25519":s={name:"Ed25519"},u=c?["verify"]:["sign"];break;case"EdDSA":s={name:Iw(a)},u=c?["verify"]:["sign"];break;default:throw new ye('Invalid or unsupported "alg" (Algorithm) value')}return te.subtle.importKey(e,a,s,i?.extractable??!1,u)},"genericImport");var Rw=o((t,e,r)=>e5(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",t,e,r),"fromSPKI");function Ow(t){let e=[],r=0;for(;r<t.length;){let n=jw(t.subarray(r));e.push(n),r+=n.byteLength}return e}o(Ow,"getElement");function jw(t){let e=0,r=t[0]&31;if(e++,r===31){for(r=0;t[e]>=128;)r=r*128+t[e]-128,e++;r=r*128+t[e]-128,e++}let n=0;if(t[e]<128)n=t[e],e++;else if(n===128){for(n=0;t[e+n]!==0||t[e+n+1]!==0;){if(n>t.byteLength)throw new TypeError("invalid indefinite form length");n++}let s=e+n+2;return{byteLength:s,contents:t.subarray(e,e+n),raw:t.subarray(0,s)}}else{let s=t[e]&127;e++,n=0;for(let u=0;u<s;u++)n=n*256+t[e],e++}let i=e+n;return{byteLength:i,contents:t.subarray(e,i),raw:t.subarray(0,i)}}o(jw,"parseElement");function t5(t){let e=Ow(Ow(jw(t).contents)[0].contents);return bh(e[e[0].raw[0]===160?6:5].raw)}o(t5,"spkiFromX509");function r5(t){let e=t.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),r=wh(e);return Tw(t5(r),"PUBLIC KEY")}o(r5,"getSPKI");var Nw=o((t,e,r)=>{let n;try{n=r5(t)}catch(i){throw new TypeError("Failed to parse the X.509 certificate",{cause:i})}return Rw(n,e,r)},"fromX509");async function Od(t,e,r){if(typeof t!="string"||t.indexOf("-----BEGIN CERTIFICATE-----")!==0)throw new TypeError('"x509" must be X.509 formatted string');return Nw(t,e,r)}o(Od,"importX509");async function dn(t,e){if(!pt(t))throw new TypeError("JWK must be an object");switch(e||(e=t.alg),t.kty){case"oct":if(typeof t.k!="string"||!t.k)throw new TypeError('missing "k" (Key Value) Parameter value');return nr(t.k);case"RSA":if("oth"in t&&t.oth!==void 0)throw new ye('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Td({...t,alg:e});default:throw new ye('Unsupported "kty" (Key Type) Parameter value')}}o(dn,"importJWK");var Wo=o(t=>t?.[Symbol.toStringTag],"tag"),Jh=o((t,e,r)=>{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?.(r)!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${r}`);if(e.alg!==void 0&&e.alg!==t)throw new TypeError(`Invalid key for this operation, when present its alg must be ${t}`);return!0},"jwkMatchesOp"),n5=o((t,e,r,n)=>{if(!(e instanceof Uint8Array)){if(n&&fn(e)){if(Cw(e)&&Jh(t,e,r))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(!Fh(e))throw new TypeError(Wh(t,e,...We,"Uint8Array",n?"JSON Web Key":null));if(e.type!=="secret")throw new TypeError(`${Wo(e)} instances for symmetric algorithms must be of type "secret"`)}},"symmetricTypeCheck"),i5=o((t,e,r,n)=>{if(n&&fn(e))switch(r){case"sign":if(Sw(e)&&Jh(t,e,r))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(kw(e)&&Jh(t,e,r))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Fh(e))throw new TypeError(Wh(t,e,...We,n?"JSON Web Key":null));if(e.type==="secret")throw new TypeError(`${Wo(e)} instances for asymmetric algorithms must not be of type "secret"`);if(r==="sign"&&e.type==="public")throw new TypeError(`${Wo(e)} instances for asymmetric algorithm signing must be of type "private"`);if(r==="decrypt"&&e.type==="public")throw new TypeError(`${Wo(e)} instances for asymmetric algorithm decryption must be of type "private"`);if(e.algorithm&&r==="verify"&&e.type==="private")throw new TypeError(`${Wo(e)} instances for asymmetric algorithm verifying must be of type "public"`);if(e.algorithm&&r==="encrypt"&&e.type==="private")throw new TypeError(`${Wo(e)} instances for asymmetric algorithm encryption must be of type "public"`)},"asymmetricTypeCheck");function Bw(t,e,r,n){e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?n5(e,r,n,t):i5(e,r,n,t)}o(Bw,"checkKeyType");var Dw=Bw.bind(void 0,!1),oc=Bw.bind(void 0,!0);async function o5(t,e,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Xe(r,"Uint8Array"));let s=parseInt(t.slice(1,4),10),u=await te.subtle.importKey("raw",r.subarray(s>>3),"AES-CBC",!1,["encrypt"]),a=await te.subtle.importKey("raw",r.subarray(0,s>>3),{hash:`SHA-${s<<1}`,name:"HMAC"},!1,["sign"]),c=new Uint8Array(await te.subtle.encrypt({iv:n,name:"AES-CBC"},u,e)),d=rr(i,n,c,lw(i.length<<3)),h=new Uint8Array((await te.subtle.sign("HMAC",a,d)).slice(0,s>>3));return{ciphertext:c,tag:h,iv:n}}o(o5,"cbcEncrypt");async function s5(t,e,r,n,i){let s;r instanceof Uint8Array?s=await te.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(Sr(r,t,"encrypt"),s=r);let u=new Uint8Array(await te.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},s,e)),a=u.slice(-16);return{ciphertext:u.slice(0,-16),tag:a,iv:n}}o(s5,"gcmEncrypt");var u5=o(async(t,e,r,n,i)=>{if(!Fe(r)&&!(r instanceof Uint8Array))throw new TypeError(Xe(r,...We,"Uint8Array"));switch(n?yw(t,n):n=hw(t),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&Hh(r,parseInt(t.slice(-3),10)),o5(t,e,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&Hh(r,parseInt(t.slice(1,4),10)),s5(t,e,r,n,i);default:throw new ye("Unsupported JWE Content Encryption Algorithm")}},"encrypt"),Rd=u5;async function qw(t,e,r,n){let i=t.slice(0,7),s=await Rd(i,r,e,n,new Uint8Array(0));return{encryptedKey:s.ciphertext,iv:Be(s.iv),tag:Be(s.tag)}}o(qw,"wrap");function a5(t,e,r,n,i){if(i.crit!==void 0&&n?.crit===void 0)throw new t('"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(u=>typeof u!="string"||u.length===0))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;r!==void 0?s=new Map([...Object.entries(r),...e.entries()]):s=e;for(let u of n.crit){if(!s.has(u))throw new ye(`Extension Header Parameter "${u}" is not recognized`);if(i[u]===void 0)throw new t(`Extension Header Parameter "${u}" is missing`);if(s.get(u)&&n[u]===void 0)throw new t(`Extension Header Parameter "${u}" MUST be integrity protected`)}return new Set(n.crit)}o(a5,"validateCrit");var Fo=a5;var c5=o((t,e)=>{if(e!==void 0&&(!Array.isArray(e)||e.some(r=>typeof r!="string")))throw new TypeError(`"${t}" option must be an array of strings`);if(e)return new Set(e)},"validateAlgorithms"),Mw=c5;var Uw=Symbol();var f5=o(async t=>{if(t instanceof Uint8Array)return{kty:"oct",k:Be(t)};if(!Fe(t))throw new TypeError(Xe(t,...We,"Uint8Array"));if(!t.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:e,key_ops:r,alg:n,use:i,...s}=await te.subtle.exportKey("jwk",t);return s},"keyToJWK"),$w=f5;async function Vw(t){return $w(t)}o(Vw,"exportJWK");async function d5(t,e,r,n,i={}){let s,u,a;switch(Dw(t,r,"encrypt"),r=await ic.normalizePublicKey?.(r,t)||r,t){case"dir":{a=r;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!_w(r))throw new ye("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:c,apv:d}=i,{epk:h}=i;h||(h=(await ww(r)).privateKey);let{x:y,y:b,crv:A,kty:S}=await Vw(h),D=await bw(r,h,t==="ECDH-ES"?e:t,t==="ECDH-ES"?Kh(e):parseInt(t.slice(-5,-2),10),c,d);if(u={epk:{x:y,crv:A,kty:S}},S==="EC"&&(u.epk.y=b),c&&(u.apu=Be(c)),d&&(u.apv=Be(d)),t==="ECDH-ES"){a=D;break}a=n||Ho(e);let I=t.slice(-6);s=await nc(I,D,a);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{a=n||Ho(e),s=await Aw(t,r,a);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{a=n||Ho(e);let{p2c:c,p2s:d}=i;({encryptedKey:s,...u}=await xw(t,r,a,c,d));break}case"A128KW":case"A192KW":case"A256KW":{a=n||Ho(e),s=await nc(t,r,a);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{a=n||Ho(e);let{iv:c}=i;({encryptedKey:s,...u}=await qw(t,r,a,c));break}default:throw new ye('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:a,encryptedKey:s,parameters:u}}o(d5,"encryptKeyManagement");var Lw=d5;var Gh=class Gh{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,r){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new wt("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Uo(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new wt("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Fo(wt,new Map,r?.crit,this._protectedHeader,n),n.zip!==void 0)throw new ye('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:i,enc:s}=n;if(typeof i!="string"||!i)throw new wt('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof s!="string"||!s)throw new wt('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let u;if(this._cek&&(i==="dir"||i==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${i}`);let a;{let D;({cek:a,encryptedKey:u,parameters:D}=await Lw(i,s,e,this._cek,this._keyManagementParameters)),D&&(r&&Uw in r?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...D}:this.setUnprotectedHeader(D):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...D}:this.setProtectedHeader(D))}let c,d,h;this._protectedHeader?d=Ne.encode(Be(JSON.stringify(this._protectedHeader))):d=Ne.encode(""),this._aad?(h=Be(this._aad),c=rr(d,Ne.encode("."),Ne.encode(h))):c=d;let{ciphertext:y,tag:b,iv:A}=await Rd(s,this._plaintext,a,this._iv,c),S={ciphertext:Be(y)};return A&&(S.iv=Be(A)),b&&(S.tag=Be(b)),u&&(S.encrypted_key=Be(u)),h&&(S.aad=h),this._protectedHeader&&(S.protected=rt.decode(d)),this._sharedUnprotectedHeader&&(S.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(S.header=this._unprotectedHeader),S}};o(Gh,"FlattenedEncrypt");var jd=Gh;function sc(t,e){let r=`SHA-${t.slice(-3)}`;switch(t){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:t.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:e.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:e.name};default:throw new ye(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}o(sc,"subtleDsa");async function uc(t,e,r){if(r==="sign"&&(e=await ic.normalizePrivateKey(e,t)),r==="verify"&&(e=await ic.normalizePublicKey(e,t)),Fe(e))return gw(e,t,r),e;if(e instanceof Uint8Array){if(!t.startsWith("HS"))throw new TypeError(Xe(e,...We));return te.subtle.importKey("raw",e,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Xe(e,...We,"Uint8Array","JSON Web Key"))}o(uc,"getCryptoKey");var l5=o(async(t,e,r,n)=>{let i=await uc(t,e,"verify");$o(t,i);let s=sc(t,i.algorithm);try{return await te.subtle.verify(s,i,r,n)}catch{return!1}},"verify"),Hw=l5;async function Ww(t,e,r){if(!pt(t))throw new be("Flattened JWS must be an object");if(t.protected===void 0&&t.header===void 0)throw new be('Flattened JWS must have either of the "protected" or "header" members');if(t.protected!==void 0&&typeof t.protected!="string")throw new be("JWS Protected Header incorrect type");if(t.payload===void 0)throw new be("JWS Payload missing");if(typeof t.signature!="string")throw new be("JWS Signature missing or incorrect type");if(t.header!==void 0&&!pt(t.header))throw new be("JWS Unprotected Header incorrect type");let n={};if(t.protected)try{let D=nr(t.protected);n=JSON.parse(rt.decode(D))}catch{throw new be("JWS Protected Header is invalid")}if(!Uo(n,t.header))throw new be("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...n,...t.header},s=Fo(be,new Map([["b64",!0]]),r?.crit,n,i),u=!0;if(s.has("b64")&&(u=n.b64,typeof u!="boolean"))throw new be('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:a}=i;if(typeof a!="string"||!a)throw new be('JWS "alg" (Algorithm) Header Parameter missing or invalid');let c=r&&Mw("algorithms",r.algorithms);if(c&&!c.has(a))throw new tc('"alg" (Algorithm) Header Parameter value not allowed');if(u){if(typeof t.payload!="string")throw new be("JWS Payload must be a string")}else if(typeof t.payload!="string"&&!(t.payload instanceof Uint8Array))throw new be("JWS Payload must be a string or an Uint8Array instance");let d=!1;typeof e=="function"?(e=await e(n,t),d=!0,oc(a,e,"verify"),fn(e)&&(e=await dn(e,a))):oc(a,e,"verify");let h=rr(Ne.encode(t.protected??""),Ne.encode("."),typeof t.payload=="string"?Ne.encode(t.payload):t.payload),y;try{y=nr(t.signature)}catch{throw new be("Failed to base64url decode the signature")}if(!await Hw(a,e,y,h))throw new rc;let A;if(u)try{A=nr(t.payload)}catch{throw new be("Failed to base64url decode the payload")}else typeof t.payload=="string"?A=Ne.encode(t.payload):A=t.payload;let S={payload:A};return t.protected!==void 0&&(S.protectedHeader=n),t.header!==void 0&&(S.unprotectedHeader=t.header),d?{...S,key:e}:S}o(Ww,"flattenedVerify");async function Fw(t,e,r){if(t instanceof Uint8Array&&(t=rt.decode(t)),typeof t!="string")throw new be("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:s,length:u}=t.split(".");if(u!==3)throw new be("Invalid Compact JWS");let a=await Ww({payload:i,protected:n,signature:s},e,r),c={payload:a.payload,protectedHeader:a.protectedHeader};return typeof e=="function"?{...c,key:a.key}:c}o(Fw,"compactVerify");var $r=o(t=>Math.floor(t.getTime()/1e3),"default");var p5=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,$i=o(t=>{let e=p5.exec(t);if(!e||e[4]&&e[1])throw new TypeError("Invalid time period format");let r=parseFloat(e[2]),n=e[3].toLowerCase(),i;switch(n){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(r*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(r*3600);break;case"day":case"days":case"d":i=Math.round(r*86400);break;case"week":case"weeks":case"w":i=Math.round(r*604800);break;default:i=Math.round(r*31557600);break}return e[1]==="-"||e[4]==="ago"?-i:i},"default");var zw=o(t=>t.toLowerCase().replace(/^application\//,""),"normalizeTyp"),h5=o((t,e)=>typeof t=="string"?e.includes(t):Array.isArray(t)?e.some(Set.prototype.has.bind(new Set(t))):!1,"checkAudiencePresence"),Kw=o((t,e,r={})=>{let n;try{n=JSON.parse(rt.decode(e))}catch{}if(!pt(n))throw new it("JWT Claims Set must be a top-level JSON object");let{typ:i}=r;if(i&&(typeof t.typ!="string"||zw(t.typ)!==zw(i)))throw new Ot('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:s=[],issuer:u,subject:a,audience:c,maxTokenAge:d}=r,h=[...s];d!==void 0&&h.push("iat"),c!==void 0&&h.push("aud"),a!==void 0&&h.push("sub"),u!==void 0&&h.push("iss");for(let S of new Set(h.reverse()))if(!(S in n))throw new Ot(`missing required "${S}" claim`,n,S,"missing");if(u&&!(Array.isArray(u)?u:[u]).includes(n.iss))throw new Ot('unexpected "iss" claim value',n,"iss","check_failed");if(a&&n.sub!==a)throw new Ot('unexpected "sub" claim value',n,"sub","check_failed");if(c&&!h5(n.aud,typeof c=="string"?[c]:c))throw new Ot('unexpected "aud" claim value',n,"aud","check_failed");let y;switch(typeof r.clockTolerance){case"string":y=$i(r.clockTolerance);break;case"number":y=r.clockTolerance;break;case"undefined":y=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:b}=r,A=$r(b||new Date);if((n.iat!==void 0||d)&&typeof n.iat!="number")throw new Ot('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new Ot('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>A+y)throw new Ot('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new Ot('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=A-y)throw new qo('"exp" claim timestamp check failed',n,"exp","check_failed")}if(d){let S=A-n.iat,D=typeof d=="number"?d:$i(d);if(S-y>D)throw new qo('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(S<0-y)throw new Ot('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n},"default");async function ac(t,e,r){let n=await Fw(t,e,r);if(n.protectedHeader.crit?.includes("b64")&&n.protectedHeader.b64===!1)throw new it("JWTs MUST NOT use unencoded payload");let s={payload:Kw(n.protectedHeader,n.payload,r),protectedHeader:n.protectedHeader};return typeof e=="function"?{...s,key:n.key}:s}o(ac,"jwtVerify");var Xh=class Xh{constructor(e){this._flattened=new jd(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,r){let n=await this._flattened.encrypt(e,r);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(".")}};o(Xh,"CompactEncrypt");var cc=Xh;var y5=o(async(t,e,r)=>{let n=await uc(t,e,"sign");$o(t,n);let i=await te.subtle.sign(sc(t,n.algorithm),n,r);return new Uint8Array(i)},"sign"),Jw=y5;var Zh=class Zh{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,r){if(!this._protectedHeader&&!this._unprotectedHeader)throw new be("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Uo(this._protectedHeader,this._unprotectedHeader))throw new be("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this._protectedHeader,...this._unprotectedHeader},i=Fo(be,new Map([["b64",!0]]),r?.crit,this._protectedHeader,n),s=!0;if(i.has("b64")&&(s=this._protectedHeader.b64,typeof s!="boolean"))throw new be('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:u}=n;if(typeof u!="string"||!u)throw new be('JWS "alg" (Algorithm) Header Parameter missing or invalid');oc(u,e,"sign");let a=this._payload;s&&(a=Ne.encode(Be(a)));let c;this._protectedHeader?c=Ne.encode(Be(JSON.stringify(this._protectedHeader))):c=Ne.encode("");let d=rr(c,Ne.encode("."),a),h=await Jw(u,e,d),y={signature:Be(h),payload:""};return s&&(y.payload=rt.decode(a)),this._unprotectedHeader&&(y.header=this._unprotectedHeader),this._protectedHeader&&(y.protected=rt.decode(c)),y}};o(Zh,"FlattenedSign");var Nd=Zh;var Qh=class Qh{constructor(e){this._flattened=new Nd(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,r){let n=await this._flattened.sign(e,r);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}`}};o(Qh,"CompactSign");var Bd=Qh;function Vi(t,e){if(!Number.isFinite(e))throw new TypeError(`Invalid ${t} input`);return e}o(Vi,"validateInput");var Yh=class Yh{constructor(e={}){if(!pt(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:Vi("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:Vi("setNotBefore",$r(e))}:this._payload={...this._payload,nbf:$r(new Date)+$i(e)},this}setExpirationTime(e){return typeof e=="number"?this._payload={...this._payload,exp:Vi("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:Vi("setExpirationTime",$r(e))}:this._payload={...this._payload,exp:$r(new Date)+$i(e)},this}setIssuedAt(e){return typeof e>"u"?this._payload={...this._payload,iat:$r(new Date)}:e instanceof Date?this._payload={...this._payload,iat:Vi("setIssuedAt",$r(e))}:typeof e=="string"?this._payload={...this._payload,iat:Vi("setIssuedAt",$r(new Date)+$i(e))}:this._payload={...this._payload,iat:Vi("setIssuedAt",e)},this}};o(Yh,"ProduceJWT");var Dd=Yh;var ey=class ey extends Dd{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,r){let n=new Bd(Ne.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 it("JWTs MUST NOT use unencoded payload");return n.sign(e,r)}};o(ey,"SignJWT");var fc=ey;var qd=nr;function ty(t){let e;if(typeof t=="string"){let r=t.split(".");(r.length===3||r.length===5)&&([e]=r)}else if(typeof t=="object"&&t)if("protected"in t)e=t.protected;else throw new TypeError("Token does not contain a Protected Header");try{if(typeof e!="string"||!e)throw new Error;let r=JSON.parse(rt.decode(qd(e)));if(!pt(r))throw new Error;return r}catch{throw new TypeError("Invalid Token or Protected Header formatting")}}o(ty,"decodeProtectedHeader");function ry(t){if(typeof t!="string")throw new it("JWTs must use Compact JWS serialization, JWT must be a string");let{1:e,length:r}=t.split(".");if(r===5)throw new it("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new it("Invalid JWT");if(!e)throw new it("JWTs must contain a payload");let n;try{n=qd(e)}catch{throw new it("Failed to base64url decode the payload")}let i;try{i=JSON.parse(rt.decode(n))}catch{throw new it("Failed to parse the decoded payload as JSON")}if(!pt(i))throw new it("Invalid JWT Claims Set");return i}o(ry,"decodeJwt");var Gw="openid4vci-proof+jwt",dc=o(async t=>{let{signer:e,audience:r,nonce:n,clientId:i}=t,s=t.now??(()=>Math.floor(Date.now()/1e3));if(typeof r!="string"||r.length===0)throw new B("proof_signing_failed","Proof JWT `audience` must be a non-empty string");let u={alg:e.alg,kid:e.kid,typ:Gw},a={aud:r,iat:s()};typeof n=="string"&&n.length>0&&(a.nonce=n),typeof i=="string"&&i.length>0&&(a.iss=i);try{return await e.sign(u,a)}catch(c){throw new B("proof_signing_failed",`Failed to sign proof JWT: ${c instanceof Error?c.message:String(c)}`,{cause:c})}},"buildProofJwt"),Md=o(async t=>{let{keypair:e,kid:r}=t;if(e.kty!=="OKP"||e.crv!=="Ed25519")throw new B("proof_signing_failed",`createJoseEd25519Signer only supports Ed25519 OKP keys (got kty=${e.kty}, crv=${e.crv})`);let n=await dn({kty:e.kty,crv:e.crv,x:e.x,d:e.d},"EdDSA");return{alg:"EdDSA",kid:r,sign:o(async(i,s)=>new fc(s).setProtectedHeader({...i,alg:"EdDSA"}).sign(n),"sign")}},"createJoseEd25519Signer");var lc=o(async t=>{let{credentialEndpoint:e,accessToken:r,tokenType:n="Bearer",credentialIdentifier:i,format:s,proofJwt:u,extra:a}=t,c=t.fetchImpl??globalThis.fetch;if(typeof c!="function")throw new B("credential_request_failed","No fetch implementation available for credential request");let d=typeof i=="string"&&i.length>0,h=typeof s=="string"&&s.length>0;if(!d&&!h)throw new B("credential_request_failed","requestCredential requires either `credentialIdentifier` (from authorization_details) or `format`");let y={proof:{proof_type:"jwt",jwt:u}};d?y.credential_identifier=i:(y.format=s,a&&Object.assign(y,a));let b;try{b=await c(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`${n} ${r}`},body:JSON.stringify(y)})}catch(S){throw new B("credential_request_failed",`Credential endpoint ${e} unreachable: ${S instanceof Error?S.message:String(S)}`,{cause:S})}let A;try{A=await b.json()}catch(S){throw new B("credential_response_invalid",`Credential endpoint ${e} returned non-JSON body`,{status:b.status,cause:S})}if(!b.ok){let S=A,D=typeof S?.error=="string"?S.error:"unknown",I=typeof S?.error_description=="string"?`: ${S.error_description}`:"";throw new B("credential_request_failed",`Credential endpoint returned ${b.status} (${D})${I}`,{status:b.status,body:A})}if(typeof A!="object"||A===null)throw new B("credential_response_invalid","Credential endpoint response was not a JSON object",{status:b.status,body:A});return A},"requestCredential");var Ud=o(async t=>{let{offer:e,signer:r}=t,n=t.options??{},i=t.fetchImpl??globalThis.fetch,s=e.grants?.[ei];if(!s)throw new B("unsupported_grant","acceptCredentialOffer currently only handles the pre-authorized_code grant. For authorization_code flows, use slice-4 APIs (not yet shipped).");if(s.tx_code&&!n.txCode)throw new B("tx_code_required","Offer requires a transaction code but none was supplied in options.txCode");let u=n.configurationIds&&n.configurationIds.length>0?n.configurationIds.filter(J=>e.credential_configuration_ids.includes(J)):e.credential_configuration_ids;if(u.length===0)throw new B("unsupported_format","No credential configuration ids in the offer matched the caller-supplied filter");let a=await Qa(e.credential_issuer,i),c=ec(a,s.authorization_server),d=await Ya(c,i),h=await gh({tokenEndpoint:d.token_endpoint,preAuthorizedCode:s["pre-authorized_code"],txCode:n.txCode,clientId:n.clientId,fetchImpl:i}),y=await dc({signer:r,audience:e.credential_issuer,nonce:h.c_nonce,clientId:n.clientId}),b=[],A,S=h.c_nonce,D=h.c_nonce_expires_in,I=w5(h.authorization_details);for(let J of u){let pe=g5(a,J),de=v5(pe),xe=I.get(J)??[],ee=xe.length>0?xe.map(ve=>({credentialIdentifier:ve})):[{credentialIdentifier:void 0}];for(let ve of ee){let ce=await lc({credentialEndpoint:a.credential_endpoint,accessToken:h.access_token,tokenType:h.token_type,credentialIdentifier:ve.credentialIdentifier,format:ve.credentialIdentifier?void 0:de,extra:ve.credentialIdentifier?void 0:b5(pe,de),proofJwt:y,fetchImpl:i});if(!ce.credential&&!Array.isArray(ce.credentials))throw new B("unsupported_format","Credential endpoint returned neither `credential` nor `credentials`; deferred issuance not supported yet",{body:ce});if(ce.credential!==void 0&&b.push({format:de,credential:ce.credential,configuration_id:J}),Array.isArray(ce.credentials))for(let Ve of ce.credentials)Ve&&typeof Ve=="object"&&"credential"in Ve&&b.push({format:de,credential:Ve.credential,configuration_id:J});typeof ce.notification_id=="string"&&(A=ce.notification_id),typeof ce.c_nonce=="string"&&(S=ce.c_nonce,D=typeof ce.c_nonce_expires_in=="number"?ce.c_nonce_expires_in:void 0)}}return{credentials:b,notification_id:A,c_nonce:S,c_nonce_expires_in:D}},"acceptCredentialOffer"),g5=o((t,e)=>{let r=t.credential_configurations_supported;if(!r||typeof r!="object"||!(e in r))return;let n=r[e];if(!(!n||typeof n!="object"))return n},"getConfigurationDefinition"),v5=o(t=>t&&typeof t.format=="string"&&t.format.length>0?t.format:"jwt_vc_json","inferFormatFromDefinition"),b5=o((t,e)=>{if(t&&(e==="jwt_vc_json"||e==="jwt_vc_json-ld"||e==="ldp_vc")){let r=t.credential_definition;if(r&&typeof r=="object")return{credential_definition:r}}},"buildFormatSpecificBody"),w5=o(t=>{let e=new Map;if(!Array.isArray(t))return e;for(let r of t){if(!r||typeof r!="object")continue;let n=r,i=n.credential_configuration_id,s=n.credential_identifiers;if(typeof i!="string"||!Array.isArray(s))continue;let u=s.filter(a=>typeof a=="string");u.length>0&&e.set(i,u)}return e},"indexAuthorizationDetails");var oy=class oy extends Error{constructor(e,r){super(r),this.name="PkceError",this.code=e}};o(oy,"PkceError");var ri=oy,ny=o(async(t={})=>{let e=t.byteLength??32;if(e<24||e>96)throw new ri("invalid_verifier",`PKCE byteLength must be between 24 and 96 (got ${e})`);let r=Xw(x5(e)),n=await iy(r);return{verifier:r,challenge:n,method:"S256"}},"generatePkcePair"),iy=o(async t=>{if(typeof t!="string"||t.length<24)throw new ri("invalid_verifier","PKCE verifier must be a base64url string with \u226524 chars");let e=new TextEncoder().encode(t),r=await A5().digest("SHA-256",e);return Xw(new Uint8Array(r))},"computeS256Challenge"),_5=o(async t=>{let e=t.method??"S256";if(e!=="S256")throw new ri("unsupported_method",`PKCE method ${e} not supported`);return await iy(t.verifier)===t.challenge},"verifyPkce"),Xw=o(t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},"toB64url"),x5=o(t=>{let e=new Uint8Array(t);return Zw().getRandomValues(e),e},"getRandomBytes"),Zw=o(()=>{let t=globalThis.crypto;if(!t)throw new ri("invalid_verifier","Web Crypto API not available in this runtime");return t},"getCrypto"),A5=o(()=>{let t=Zw().subtle;if(!t)throw new ri("invalid_verifier","crypto.subtle not available in this runtime");return t},"getSubtle");var sy="authorization_code",uy=o(async t=>{let e=t.fetchImpl??globalThis.fetch;if(!t.clientId||t.clientId.length===0)throw new B("token_request_failed","beginAuthCodeFlow requires a non-empty `clientId` \u2014 the AS cannot track the request otherwise");if(!t.redirectUri||t.redirectUri.length===0)throw new B("token_request_failed","beginAuthCodeFlow requires a non-empty `redirectUri`");let r=t.offer.grants?.[sy];if(!r)throw new B("unsupported_grant","Offer does not advertise the authorization_code grant. Use acceptCredentialOffer for pre-auth offers.");let n=k5(t.offer,t.configurationIds),i=await Qa(t.offer.credential_issuer,e),s=ec(i,r.authorization_server),u=await Ya(s,e);if(typeof u.authorization_endpoint!="string")throw new B("metadata_invalid","Authorization server metadata is missing `authorization_endpoint` \u2014 cannot run auth_code flow");let a=await ny(),c=I5(),d=Qw({authorizationEndpoint:u.authorization_endpoint,clientId:t.clientId,redirectUri:t.redirectUri,configurationIds:n,scope:t.scope,pkce:a,state:c,issuerState:typeof r.issuer_state=="string"?r.issuer_state:void 0}),h={version:1,issuer:t.offer.credential_issuer,tokenEndpoint:u.token_endpoint,credentialEndpoint:i.credential_endpoint,configurationIds:n,redirectUri:t.redirectUri,clientId:t.clientId,state:c,pkceVerifier:a.verifier,pkceMethod:a.method,credentialConfigurations:i.credential_configurations_supported??{}};return{authorizationUrl:d,flowHandle:h}},"beginAuthCodeFlow"),ay=o(async t=>{let{flowHandle:e,code:r,signer:n}=t,i=t.fetchImpl??globalThis.fetch;if(t.state&&t.state!==e.state)throw new B("token_request_failed",`State parameter mismatch (callback state=${t.state}, expected ${e.state})`);let s=await Yw({tokenEndpoint:e.tokenEndpoint,code:r,codeVerifier:e.pkceVerifier,clientId:e.clientId,redirectUri:e.redirectUri,fetchImpl:i}),u=await dc({signer:n,audience:e.issuer,nonce:s.c_nonce,clientId:e.clientId});return S5({flowHandle:e,tokenResponse:s,proofJwt:u,fetchImpl:i})},"completeAuthCodeFlow"),Qw=o(t=>{let e=new URL(t.authorizationEndpoint);e.searchParams.set("response_type","code"),e.searchParams.set("client_id",t.clientId),e.searchParams.set("redirect_uri",t.redirectUri),e.searchParams.set("code_challenge",t.pkce.challenge),e.searchParams.set("code_challenge_method",t.pkce.method),e.searchParams.set("state",t.state);let r=t.configurationIds.map(n=>({type:"openid_credential",credential_configuration_id:n}));return e.searchParams.set("authorization_details",JSON.stringify(r)),t.scope&&e.searchParams.set("scope",t.scope),t.issuerState&&e.searchParams.set("issuer_state",t.issuerState),e.toString()},"buildAuthorizationUrl"),Yw=o(async t=>{let{tokenEndpoint:e,code:r,codeVerifier:n,clientId:i,redirectUri:s}=t,u=t.fetchImpl??globalThis.fetch;if(typeof u!="function")throw new B("token_request_failed","No fetch implementation available for authorization_code token exchange");let a=new URLSearchParams;a.set("grant_type",sy),a.set("code",r),a.set("code_verifier",n),a.set("client_id",i),a.set("redirect_uri",s);let c;try{c=await u(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:a.toString()})}catch(h){throw new B("token_request_failed",`Token endpoint ${e} unreachable: ${h instanceof Error?h.message:String(h)}`,{cause:h})}let d;try{d=await c.json()}catch(h){throw new B("token_response_invalid",`Token endpoint ${e} returned non-JSON body`,{status:c.status,cause:h})}if(!c.ok){let h=d,y=typeof h?.error=="string"?h.error:"unknown",b=typeof h?.error_description=="string"?`: ${h.error_description}`:"";throw new B("token_request_failed",`Token endpoint returned ${c.status} (${y})${b}`,{status:c.status,body:d})}if(!T5(d))throw new B("token_response_invalid","Token endpoint response is missing required `access_token` / `token_type`",{status:c.status,body:d});return d},"exchangeAuthorizationCode"),S5=o(async t=>{let e=[],r,n=t.tokenResponse.c_nonce,i=t.tokenResponse.c_nonce_expires_in,s=P5(t.tokenResponse.authorization_details);for(let u of t.flowHandle.configurationIds){let a=t.flowHandle.credentialConfigurations[u],c=C5(a),d=s.get(u)??[],h=d.length>0?d.map(y=>({credentialIdentifier:y})):[{credentialIdentifier:void 0}];for(let y of h){let b=await lc({credentialEndpoint:t.flowHandle.credentialEndpoint,accessToken:t.tokenResponse.access_token,tokenType:t.tokenResponse.token_type,credentialIdentifier:y.credentialIdentifier,format:y.credentialIdentifier?void 0:c,extra:y.credentialIdentifier?void 0:E5(a,c),proofJwt:t.proofJwt,fetchImpl:t.fetchImpl});if(!b.credential&&!Array.isArray(b.credentials))throw new B("unsupported_format","Credential endpoint returned neither `credential` nor `credentials`; deferred issuance not supported yet",{body:b});if(b.credential!==void 0&&e.push({format:c,credential:b.credential,configuration_id:u}),Array.isArray(b.credentials))for(let A of b.credentials)A&&typeof A=="object"&&"credential"in A&&e.push({format:c,credential:A.credential,configuration_id:u});typeof b.notification_id=="string"&&(r=b.notification_id),typeof b.c_nonce=="string"&&(n=b.c_nonce,i=typeof b.c_nonce_expires_in=="number"?b.c_nonce_expires_in:void 0)}}return{credentials:e,notification_id:r,c_nonce:n,c_nonce_expires_in:i}},"fetchCredentialsForToken"),k5=o((t,e)=>{let r=e&&e.length>0?e.filter(n=>t.credential_configuration_ids.includes(n)):t.credential_configuration_ids;if(r.length===0)throw new B("unsupported_format","No credential configuration ids matched the caller-supplied filter");return r},"filterConfigurationIds"),C5=o(t=>t&&typeof t=="object"&&typeof t.format=="string"?t.format:"jwt_vc_json","inferFormat"),E5=o((t,e)=>{if(!(!t||typeof t!="object")&&(e==="jwt_vc_json"||e==="jwt_vc_json-ld"||e==="ldp_vc")){let r=t.credential_definition;if(r&&typeof r=="object")return{credential_definition:r}}},"formatSpecificBody"),P5=o(t=>{let e=new Map;if(!Array.isArray(t))return e;for(let r of t){if(!r||typeof r!="object")continue;let n=r,i=n.credential_configuration_id,s=n.credential_identifiers;if(typeof i!="string"||!Array.isArray(s))continue;let u=s.filter(a=>typeof a=="string");u.length>0&&e.set(i,u)}return e},"indexAuthorizationDetails"),T5=o(t=>{if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.access_token=="string"&&e.access_token.length>0&&typeof e.token_type=="string"&&e.token_type.length>0},"isTokenResponse"),I5=o(()=>{let t=globalThis.crypto;if(!t)throw new Error("Web Crypto API not available in this runtime");let e=new Uint8Array(16);t.getRandomValues(e);let r="";for(let n=0;n<e.length;n++)r+=e[n].toString(16).padStart(2,"0");return r},"randomId");var cy=o((t,e)=>{switch(e){case"jwt_vc_json":case"jwt_vc":case"jwt_vc_json-ld":return O5(t,e);case"ldp_vc":if(!e_(t))throw new B("unsupported_format",`ldp_vc credential was not a JSON-LD object (received ${typeof t})`);return{vc:t,rawFormat:e};default:throw new B("unsupported_format",`Credential format "${e}" is not yet supported by the openid4vc plugin`)}},"normalizeIssuedCredential"),O5=o((t,e)=>{if(typeof t!="string")throw new B("unsupported_format",`${e} credential must be a compact JWS string (received ${typeof t})`);let r;try{r=ry(t)}catch(h){throw new B("unsupported_format",`Failed to decode ${e} credential as a JWT: ${h instanceof Error?h.message:String(h)}`,{cause:h})}let n=r.vc;if(!e_(n))throw new B("unsupported_format",`${e} credential JWT is missing the required \`vc\` claim`);let i={...n};if(typeof r.jti=="string"&&!i.id&&(i.id=r.jti),typeof r.iss=="string"&&!j5(i)&&(i.issuer=r.iss),typeof r.sub=="string")if(i.credentialSubject&&!Array.isArray(i.credentialSubject)){let h=i.credentialSubject;h.id||(h.id=r.sub)}else i.credentialSubject||(i.credentialSubject={id:r.sub});let s=typeof r.nbf=="number"?r.nbf:typeof r.iat=="number"?r.iat:void 0;s!==void 0&&!i.issuanceDate&&!i.validFrom&&(i.issuanceDate=new Date(s*1e3).toISOString()),typeof r.exp=="number"&&!i.expirationDate&&!i.validUntil&&(i.expirationDate=new Date(r.exp*1e3).toISOString());let u=i.issuanceDate??(typeof i.validFrom=="string"?i.validFrom:void 0)??new Date().toISOString(),a=R5(i.issuer)??(typeof r.iss=="string"?r.iss:void 0),c;try{let h=ty(t);typeof h?.kid=="string"&&h.kid.length>0&&(c=h.kid)}catch{}let d=c?c.startsWith("#")&&a?`${a}${c}`:c:a?`${a}#0`:"urn:openid4vci:unknown-verification-method";return i.proof={type:"JwtProof2020",created:u,proofPurpose:"assertionMethod",verificationMethod:d,jwt:t},{vc:i,rawFormat:e,jwt:t}},"decodeJwtVc"),R5=o(t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"){let e=t.id;if(typeof e=="string"&&e.length>0)return e}},"pickIssuerId"),e_=o(t=>{if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=t;return"@context"in e||"type"in e||"credentialSubject"in e},"isVcObject"),j5=o(t=>t.issuer?typeof t.issuer=="string"?t.issuer.length>0:typeof t.issuer=="object"&&t.issuer!==null?typeof t.issuer.id=="string"&&t.issuer.id.length>0:!1:!1,"hasIssuer");var t_="LearnCloud",fy=o(async(t,e,r={})=>{let n=r.storage??t_,i=r.encrypt??!0,s=r.makeId??F5,u=r.upload??V5(t,n,i),a=r.addToIndex??L5(t,n),c=[],d=[];for(let h=0;h<e.credentials.length;h++){let y=e.credentials[h];try{let b=cy(y.credential,y.format),A=await H5(u,b.vc),S=s(),D={id:S,uri:A,category:N5(r.category,b.vc,h),...$d(r.title,b.vc,h)&&{title:$d(r.title,b.vc,h)},...$d(r.imgUrl,b.vc,h)&&{imgUrl:$d(r.imgUrl,b.vc,h)},__v:1};await W5(a,D),c.push({uri:A,recordId:S,vc:b.vc,configurationId:y.configuration_id,format:b.rawFormat})}catch(b){d.push({configurationId:y.configuration_id,format:y.format,error:b instanceof B?b:new B("store_failed",`Unexpected error while storing credential: ${b instanceof Error?b.message:String(b)}`,{cause:b})})}}return{stored:c,failures:d}},"storeAcceptedCredentials"),N5=o((t,e,r)=>typeof t=="string"?t:typeof t=="function"?t(e,r):B5(e),"resolveCategory"),$d=o((t,e,r)=>{if(typeof t=="string")return t;if(typeof t=="function")return t(e,r)},"resolveOptional"),B5=o(t=>{let e=$5(t.type);return e.some(Vd(D5))?"ID":e.some(Vd(q5))?"Achievement":e.some(Vd(M5))?"Work":e.some(Vd(U5))?"Learning History":"Achievement"},"defaultCategoryFor"),D5=["IdentityCredential","VerifiableId","MobileDriversLicense"],q5=["OpenBadgeCredential","AchievementCredential","UniversityDegreeCredential","MicroCredential"],M5=["EmploymentCredential","WorkExperienceCredential"],U5=["CourseCompletionCredential","LearningHistoryCredential"],Vd=o(t=>e=>t.includes(e),"matchesAny"),$5=o(t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):typeof t=="string"?[t]:[],"toTypeArray"),V5=o((t,e,r)=>{let i=t.store?.[e];if(!i)throw new B("store_plane_missing",`LearnCard has no store plugin named "${e}" \u2014 did you forget to add @learncard/learn-cloud-plugin?`);if(r&&typeof i.uploadEncrypted=="function")return s=>i.uploadEncrypted(s);if(typeof i.upload=="function")return s=>i.upload(s);throw new B("store_plane_missing",`Store plugin "${e}" implements neither \`upload\` nor \`uploadEncrypted\``)},"resolveUpload"),L5=o((t,e)=>{let n=t.index?.[e];if(!n||typeof n.add!="function")throw new B("index_plane_missing",`LearnCard has no index plugin named "${e}" exposing an \`add\` method`);return i=>n.add(i)},"resolveAddToIndex"),H5=o(async(t,e)=>{let r;try{r=await t(e)}catch(n){throw new B("store_failed",`Store plane rejected the credential upload: ${n instanceof Error?n.message:String(n)}`,{cause:n})}if(typeof r!="string"||r.length===0)throw new B("store_failed","Store plane upload returned an empty URI \u2014 refusing to index an unresolvable credential");return r},"safeUpload"),W5=o(async(t,e)=>{try{await t(e)}catch(r){throw new B("index_failed",`Index plane rejected the credential record: ${r instanceof Error?r.message:String(r)}`,{cause:r})}},"safeAddToIndex"),F5=o(()=>{let t=globalThis.crypto;if(t&&typeof t.randomUUID=="function")return t.randomUUID();let e=new Uint8Array(16),r=globalThis.crypto;if(r&&typeof r.getRandomValues=="function")r.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");var dy=class dy extends Error{constructor(e,r,n){super(r),this.name="VpError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}};o(dy,"VpError");var re=dy;var Hee=Ui(n_());var Ze={};lh(Ze,{Any:()=>Jt,BaseBlock:()=>De,BaseStringBlock:()=>gc,BitString:()=>Nt,BmpString:()=>gn,Boolean:()=>hn,CharacterString:()=>Cn,Choice:()=>oi,Constructed:()=>me,DATE:()=>Ac,DateTime:()=>kc,Duration:()=>Cc,EndOfContent:()=>vc,Enumerated:()=>yn,GeneralString:()=>kn,GeneralizedTime:()=>En,GraphicString:()=>Sn,HexBlock:()=>Wr,IA5String:()=>An,Integer:()=>kr,Null:()=>st,NumericString:()=>bn,ObjectIdentifier:()=>mn,OctetString:()=>ut,Primitive:()=>Kt,PrintableString:()=>wn,RawData:()=>gy,RelativeObjectIdentifier:()=>xc,Repeated:()=>Pn,Sequence:()=>_e,Set:()=>ke,TIME:()=>Ec,TeletexString:()=>_n,TimeOfDay:()=>Sc,UTCTime:()=>Hr,UniversalString:()=>vn,Utf8String:()=>Bt,ValueBlock:()=>ot,VideotexString:()=>xn,ViewWriter:()=>Jo,VisibleString:()=>Lr,compareSchema:()=>or,fromBER:()=>at,verifySchema:()=>lk});var ne=Ui(Ko());function Li(t,e){let r=0;if(t.length===1)return t[0];for(let n=t.length-1;n>=0;n--)r+=t[t.length-1-n]*Math.pow(2,e*n);return r}o(Li,"utilFromBase");function ii(t,e,r=-1){let n=r,i=t,s=0,u=Math.pow(2,e);for(let a=1;a<8;a++){if(t<u){let c;if(n<0)c=new ArrayBuffer(a),s=a;else{if(n<a)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}let d=new Uint8Array(c);for(let h=a-1;h>=0;h--){let y=Math.pow(2,h*e);d[s-h-1]=Math.floor(i/y),i-=d[s-h-1]*y}return c}u*=Math.pow(2,e)}return new ArrayBuffer(0)}o(ii,"utilToBase");function Wd(...t){let e=0,r=0;for(let s of t)e+=s.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of t)i.set(s,r),r+=s.length;return i}o(Wd,"utilConcatView");function yy(){let t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=t[0]===255&&t[1]&128,c=t[0]===0&&(t[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)r[a]=0;r[0]=t[0]&128;let n=Li(r,8),i=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(i);for(let a=0;a<this.valueHex.byteLength;a++)s[a]=t[a];return s[0]&=127,Li(s,8)-n}o(yy,"utilDecodeTC");function i_(t){let e=t<0?t*-1:t,r=128;for(let n=1;n<8;n++){if(e<=r){if(t<0){let u=r-e,a=ii(u,8,n),c=new Uint8Array(a);return c[0]|=128,a}let i=ii(e,8,n),s=new Uint8Array(i);if(s[0]&128){let u=i.slice(0),a=new Uint8Array(u);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let c=0;c<u.byteLength;c++)s[c+1]=a[c];s[0]=0}return i}r*=Math.pow(2,8)}return new ArrayBuffer(0)}o(i_,"utilEncodeTC");function o_(t,e){if(t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let i=0;i<r.length;i++)if(r[i]!==n[i])return!1;return!0}o(o_,"isEqualBuffer");function Rt(t,e){let r=t.toString(10);if(e<r.length)return"";let n=e-r.length,i=new Array(n);for(let u=0;u<n;u++)i[u]="0";return i.join("").concat(r)}o(Rt,"padNumber");var oB=Math.log(2);function Fd(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(Fd,"assertBigInt");function vy(t){let e=0,r=0;for(let i=0;i<t.length;i++){let s=t[i];e+=s.byteLength}let n=new Uint8Array(e);for(let i=0;i<t.length;i++){let s=t[i];n.set(new Uint8Array(s),r),r+=s.byteLength}return n.buffer}o(vy,"concat");function Tn(t,e,r,n){return e instanceof Uint8Array?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",!1):n<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-n<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(Tn,"checkBufferParams");var wy=class wy{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return vy(this.items)}};o(wy,"ViewWriter");var Jo=wy,hc=[new Uint8Array([1])],s_="0123456789",my="name",u_="valueHexView",ek="isHexOnly",tk="idBlock",rk="tagClass",nk="tagNumber",ik="isConstructed",ok="fromBER",sk="toBER",uk="local",jt="",Cr=new ArrayBuffer(0),sl=new Uint8Array(0),mc="EndOfContent",c_="OCTET STRING",f_="BIT STRING";function Wr(t){var r;var e;return e=(r=class extends t{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var s;super(...i);let u=i[0]||{};this.isHexOnly=(s=u.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=u.valueHex?ne.BufferSourceConverter.toUint8Array(u.valueHex):sl}fromBER(i,s,u){let a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!Tn(this,a,s,u))return-1;let c=s+u;return this.valueHexView=a.subarray(s,c),this.valueHexView.length?(this.blockLength=u,c):(this.warnings.push("Zero buffer length"),s)}toBER(i=!1){return this.isHexOnly?i?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",Cr)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:ne.Convert.ToHex(this.valueHexView)}}},o(r,"Some"),r),e.NAME="hexBlock",e}o(Wr,"HexBlock");var _y=class _y{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:r=jt,warnings:n=[],valueBeforeDecode:i=sl}={}){this.blockLength=e,this.error=r,this.warnings=n,this.valueBeforeDecodeView=ne.BufferSourceConverter.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:ne.Convert.ToHex(this.valueBeforeDecodeView)}}};o(_y,"LocalBaseBlock");var pn=_y;pn.NAME="baseBlock";var xy=class xy extends pn{fromBER(e,r,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};o(xy,"ValueBlock");var ot=xy;ot.NAME="valueBlock";var Ay=class Ay extends Wr(pn){constructor({idBlock:e={}}={}){var r,n,i,s;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=e.valueHex?ne.BufferSourceConverter.toUint8Array(e.valueHex):sl,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",Cr}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,r|=s,i[0]=r}return i.buffer}if(!this.isHexOnly){let i=ii(this.tagNumber,7),s=new Uint8Array(i),u=i.byteLength,a=new Uint8Array(u+1);if(a[0]=r|31,!e){for(let c=0;c<u-1;c++)a[c+1]=s[c]|128;a[u]=s[u-1]}return a.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=r|31,!e){let i=this.valueHexView;for(let s=0;s<i.length-1;s++)n[s+1]=i[s]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,r,n){let i=ne.BufferSourceConverter.toUint8Array(e);if(!Tn(this,i,r,n))return-1;let s=i.subarray(r,r+n);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[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=(s[0]&32)===32,this.isHexOnly=!1;let a=s[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=1,d=this.valueHexView=new Uint8Array(255),h=255;for(;s[c]&128;){if(d[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===h){h+=255;let b=new Uint8Array(h);for(let A=0;A<d.length;A++)b[A]=d[A];d=this.valueHexView=new Uint8Array(h)}}this.blockLength=c+1,d[c-1]=s[c]&127;let y=new Uint8Array(c);for(let b=0;b<c;b++)y[b]=d[b];d=this.valueHexView=new Uint8Array(c),d.set(y),this.blockLength<=9?this.tagNumber=Li(d,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 r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};o(Ay,"LocalIdentificationBlock");var zd=Ay;zd.NAME="identificationBlock";var Sy=class Sy extends pn{constructor({lenBlock:e={}}={}){var r,n,i;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:!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,r,n){let i=ne.BufferSourceConverter.toUint8Array(e);if(!Tn(this,i,r,n))return-1;let s=i.subarray(r,r+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;let u=s[0]&127;if(u>8)return this.error="Too big integer",-1;if(u+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let a=r+1,c=i.subarray(a,a+u);return c[u-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Li(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=u+1,r+this.blockLength}toBER(e=!1){let r,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(r),n[0]=128),r;if(this.longFormUsed){let i=ii(this.length,8);if(i.byteLength>127)return this.error="Too big length",Cr;if(r=new ArrayBuffer(i.byteLength+1),e)return r;let s=new Uint8Array(i);n=new Uint8Array(r),n[0]=i.byteLength|128;for(let u=0;u<i.byteLength;u++)n[u+1]=s[u];return r}return r=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(r),n[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};o(Sy,"LocalLengthBlock");var Kd=Sy;Kd.NAME="lengthBlock";var R={},ky=class ky extends pn{constructor({name:e=jt,optional:r=!1,primitiveSchema:n,...i}={},s){super(i),this.name=e,this.optional=r,n&&(this.primitiveSchema=n),this.idBlock=new zd(i),this.lenBlock=new Kd(i),this.valueBlock=s?new s(i):new ot(i)}fromBER(e,r,n){let i=this.valueBlock.fromBER(e,r,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,r){let n=r||new Jo;r||d_(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 s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let u=this.lenBlock.toBER(e);n.write(u),n.write(s)}return r?Cr: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():ne.Convert.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,r=ne.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${r}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let r=this.toBER(),n=e.toBER();return o_(r,n)}};o(ky,"BaseBlock");var De=ky;De.NAME="BaseBlock";function d_(t){var e;if(t instanceof R.Constructed)for(let r of t.valueBlock.value)d_(r)&&(t.lenBlock.isIndefiniteForm=!0);return!!(!((e=t.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(d_,"prepareIndefiniteForm");var Cy=class Cy extends De{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=jt,...r}={},n){super(r,n),e&&this.fromString(e)}fromBER(e,r,n){let i=this.valueBlock.fromBER(e,r,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}'`}};o(Cy,"BaseStringBlock");var gc=Cy;gc.NAME="BaseStringBlock";var Ey=class Ey extends Wr(ot){constructor({isHexOnly:e=!0,...r}={}){super(r),this.isHexOnly=e}};o(Ey,"LocalPrimitiveValueBlock");var Jd=Ey;Jd.NAME="PrimitiveValueBlock";var l_,Py=class Py extends De{constructor(e={}){super(e,Jd),this.idBlock.isConstructed=!1}};o(Py,"Primitive");var Kt=Py;l_=Kt;R.Primitive=l_;Kt.NAME="PRIMITIVE";function ak(t,e){if(t instanceof e)return t;let r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}o(ak,"localChangeType");function Go(t,e=0,r=t.length){let n=e,i=new De({},ot),s=new pn;if(!Tn(s,t,e,r))return i.error=s.error,{offset:-1,result:i};if(!t.subarray(e,e+r).length)return i.error="Zero buffer length",{offset:-1,result:i};let a=i.idBlock.fromBER(t,e,r);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),a===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=a,r-=i.idBlock.blockLength,a=i.lenBlock.fromBER(t,e,r),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),a===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=a,r-=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 c=De;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};c=R.EndOfContent;break;case 1:c=R.Boolean;break;case 2:c=R.Integer;break;case 3:c=R.BitString;break;case 4:c=R.OctetString;break;case 5:c=R.Null;break;case 6:c=R.ObjectIdentifier;break;case 10:c=R.Enumerated;break;case 12:c=R.Utf8String;break;case 13:c=R.RelativeObjectIdentifier;break;case 14:c=R.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:c=R.Sequence;break;case 17:c=R.Set;break;case 18:c=R.NumericString;break;case 19:c=R.PrintableString;break;case 20:c=R.TeletexString;break;case 21:c=R.VideotexString;break;case 22:c=R.IA5String;break;case 23:c=R.UTCTime;break;case 24:c=R.GeneralizedTime;break;case 25:c=R.GraphicString;break;case 26:c=R.VisibleString;break;case 27:c=R.GeneralString;break;case 28:c=R.UniversalString;break;case 29:c=R.CharacterString;break;case 30:c=R.BmpString;break;case 31:c=R.DATE;break;case 32:c=R.TimeOfDay;break;case 33:c=R.DateTime;break;case 34:c=R.Duration;break;default:{let d=i.idBlock.isConstructed?new R.Constructed:new R.Primitive;d.idBlock=i.idBlock,d.lenBlock=i.lenBlock,d.warnings=i.warnings,i=d}}break;default:c=i.idBlock.isConstructed?R.Constructed:R.Primitive}return i=ak(i,c),a=i.fromBER(t,e,i.lenBlock.isIndefiniteForm?r:i.lenBlock.length),i.valueBeforeDecodeView=t.subarray(n,n+i.blockLength),{offset:a,result:i}}o(Go,"localFromBER");function at(t){if(!t.byteLength){let e=new De({},ot);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Go(ne.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength)}o(at,"fromBER");function ck(t,e){return t?1:e}o(ck,"checkLen");var Ty=class Ty extends ot{constructor({value:e=[],isIndefiniteForm:r=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=r}fromBER(e,r,n){let i=ne.BufferSourceConverter.toUint8Array(e);if(!Tn(this,i,r,n))return-1;if(this.valueBeforeDecodeView=i.subarray(r,r+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;ck(this.isIndefiniteForm,n)>0;){let u=Go(i,s,n);if(u.offset===-1)return this.error=u.result.error,this.warnings.concat(u.result.warnings),-1;if(s=u.offset,this.blockLength+=u.result.blockLength,n-=u.result.blockLength,this.value.push(u.result),this.isIndefiniteForm&&u.result.constructor.NAME===mc)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===mc?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,r){let n=r||new Jo;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return r?Cr:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let r of this.value)e.value.push(r.toJSON());return e}};o(Ty,"LocalConstructedValueBlock");var Vr=Ty;Vr.NAME="ConstructedValueBlock";var p_,Iy=class Iy extends De{constructor(e={}){super(e,Vr),this.idBlock.isConstructed=!0}fromBER(e,r,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,r,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
11
|
`).map(i=>` ${i}`).join(`
|
|
12
12
|
`));let r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${r} :
|
|
13
13
|
${e.join(`
|
|
14
|
-
`)}`:`${r} :`}};o(ay,"Constructed");var $e=ay;Dw=$e;R.Constructed=Dw;$e.NAME="CONSTRUCTED";var cy=class cy extends Qe{fromBER(e,r,n){return r}toBER(e){return lr}};o(cy,"LocalEndOfContentValueBlock");var Od=cy;Od.override="EndOfContentValueBlock";var qw,fy=class fy extends Ue{constructor(e={}){super(e,Od),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};o(fy,"EndOfContent");var ic=fy;qw=ic;R.EndOfContent=qw;ic.NAME=rc;var Mw,dy=class dy extends Ue{constructor(e={}){super(e,Qe),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,r,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,r+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+n}toBER(e,r){let n=new ArrayBuffer(2);if(!e){let i=new Uint8Array(n);i[0]=5,i[1]=0}return r&&r.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}};o(dy,"Null");var cr=dy;Mw=cr;R.Null=Mw;cr.NAME="NULL";var ly=class ly extends Tr(Qe){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,...r}={}){super(r),r.valueHex?this.valueHexView=re.BufferSourceConverter.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,r,n){let i=re.BufferSourceConverter.toUint8Array(e);return nn(this,i,r,n)?(this.valueHexView=i.subarray(r,r+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Jh.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};o(ly,"LocalBooleanValueBlock");var Rd=ly;Rd.NAME="BooleanValueBlock";var Uw,py=class py extends Ue{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,Rd),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};o(py,"Boolean");var mi=py;Uw=mi;R.Boolean=Uw;mi.NAME="BOOLEAN";var hy=class hy extends Tr(Er){constructor({isConstructed:e=!1,...r}={}){super(r),this.isConstructed=e}fromBER(e,r,n){let i=0;if(this.isConstructed){if(this.isHexOnly=!1,i=Er.prototype.fromBER.call(this,e,r,n),i===-1)return i;for(let s=0;s<this.value.length;s++){let u=this.value[s].constructor.NAME;if(u===rc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(u!==Rw)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,i=super.fromBER(e,r,n),this.blockLength=n;return i}toBER(e,r){return this.isConstructed?Er.prototype.toBER.call(this,e,r):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};o(hy,"LocalOctetStringValueBlock");var jd=hy;jd.NAME="OctetStringValueBlock";var Zh,yy=class yy extends Ue{constructor({idBlock:e={},lenBlock:r={},...n}={}){var i,s;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},jd),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,r,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),r;if(!this.valueBlock.isConstructed){let s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(r,r+n);try{if(s.byteLength){let u=Bo(s,0,s.byteLength);u.offset!==-1&&u.offset===n&&(this.valueBlock.value=[u.result])}}catch{}}return super.fromBER(e,r,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return $e.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,r=re.Convert.ToHex(this.valueBlock.valueHexView);return`${e} : ${r}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let r of this.valueBlock.value)r instanceof Zh&&e.push(r.valueBlock.valueHexView);return re.BufferSourceConverter.concat(e)}};o(yy,"OctetString");var fr=yy;Zh=fr;R.OctetString=Zh;fr.NAME=Rw;var my=class my extends Tr(Er){constructor({unusedBits:e=0,isConstructed:r=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(e,r,n){if(!n)return r;let i=-1;if(this.isConstructed){if(i=Er.prototype.fromBER.call(this,e,r,n),i===-1)return i;for(let a of this.value){let c=a.constructor.NAME;if(c===rc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==jw)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let d=a.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return i}let s=re.BufferSourceConverter.toUint8Array(e);if(!nn(this,s,r,n))return-1;let u=s.subarray(r,r+n);if(this.unusedBits=u[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let a=u.subarray(1);try{if(a.byteLength){let c=Bo(a,0,a.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=u.subarray(1),this.blockLength=u.length,r+n}toBER(e,r){if(this.isConstructed)return Er.prototype.toBER.call(this,e,r);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return lr;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}}};o(my,"LocalBitStringValueBlock");var Nd=my;Nd.NAME="BitStringValueBlock";var $w,gy=class gy extends Ue{constructor({idBlock:e={},lenBlock:r={},...n}={}){var i,s;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Nd),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,r,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,r,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return $e.prototype.onAsciiEncoding.call(this);{let e=[],r=this.valueBlock.valueHexView;for(let u of r)e.push(u.toString(2).padStart(8,"0"));let n=e.join(""),i=this.constructor.NAME,s=n.substring(0,n.length-this.valueBlock.unusedBits);return`${i} : ${s}`}}};o(gy,"BitString");var dr=gy;$w=dr;R.BitString=$w;dr.NAME=jw;var Vw;function k5(t,e){let r=new Uint8Array([0]),n=new Uint8Array(t),i=new Uint8Array(e),s=n.slice(0),u=s.length-1,a=i.slice(0),c=a.length-1,d=0,p=c<u?u:c,y=0;for(let v=p;v>=0;v--,y++)!0===y<a.length?d=s[u-y]+a[c-y]+r[0]:d=s[u-y]+r[0],r[0]=d/10,!0===y>=s.length?s=Cd(new Uint8Array([d%10]),s):s[u-y]=d%10;return r[0]>0&&(s=Cd(r,s)),s}o(k5,"viewAdd");function Ow(t){if(t>=ec.length)for(let e=ec.length;e<=t;e++){let r=new Uint8Array([0]),n=ec[e-1].slice(0);for(let i=n.length-1;i>=0;i--){let s=new Uint8Array([(n[i]<<1)+r[0]]);r[0]=s[0]/10,n[i]=s[0]%10}r[0]>0&&(n=Cd(r,n)),ec.push(n)}return ec[t]}o(Ow,"power2");function C5(t,e){let r=0,n=new Uint8Array(t),i=new Uint8Array(e),s=n.slice(0),u=s.length-1,a=i.slice(0),c=a.length-1,d,p=0;for(let y=c;y>=0;y--,p++)d=s[u-p]-a[c-p]-r,!0===d<0?(r=1,s[u-p]=d+10):(r=0,s[u-p]=d);if(r>0)for(let y=u-c+1;y>=0;y--,p++)if(d=s[u-p]-r,d<0)r=1,s[u-p]=d+10;else{r=0,s[u-p]=d;break}return s.slice()}o(C5,"viewSub");var vy=class vy extends Tr(Qe){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=Jh.call(this)))}constructor({value:e,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Ew(e))}get valueDec(){return this._valueDec}fromDER(e,r,n,i=0){let s=this.fromBER(e,r,n);if(s===-1)return s;let u=this.valueHexView;return u[0]===0&&(u[1]&128)!==0?this.valueHexView=u.subarray(1):i!==0&&u.length<i&&(i-u.length>1&&(i=u.length+1),this.valueHexView=u.subarray(i-u.length)),s}toDER(e=!1){let r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(r,1),this.valueHexView=n}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,r,n){let i=super.fromBER(e,r,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,r=new Uint8Array(this.valueHexView.length*8/3),n=0,i,s=this.valueHexView,u="",a=!1;for(let c=s.byteLength-1;c>=0;c--){i=s[c];for(let d=0;d<8;d++)(i&1)===1&&(n===e?(r=C5(Ow(n),r),u="-"):r=k5(r,Ow(n))),n++,i>>=1}for(let c=0;c<r.length;c++)r[c]&&(a=!0),a&&(u+=Tw.charAt(r[c]));return a===!1&&(u+=Tw.charAt(0)),u}};o(vy,"LocalIntegerValueBlock");var oc=vy;Vw=oc;oc.NAME="IntegerValueBlock";Object.defineProperty(Vw.prototype,"valueHex",{set:o(function(t){this.valueHexView=new Uint8Array(t),this.setValueHex()},"set"),get:o(function(){return this.valueHexView.slice().buffer},"get")});var tc,by=class by extends Ue{constructor(e={}){super(e,oc),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ed(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Ed();let r=BigInt(e),n=new jo,i=r.toString(16).replace(/^-/,""),s=new Uint8Array(re.Convert.FromHex(i));if(r<0){let a=new Uint8Array(s.length+(s[0]&128?1:0));a[0]|=128;let d=BigInt(`0x${re.Convert.ToHex(a)}`)+r,p=re.BufferSourceConverter.toUint8Array(re.Convert.FromHex(d.toString(16)));p[0]|=128,n.write(p)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new tc({valueHex:n.final()})}convertToDER(){let e=new tc({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new tc({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};o(by,"Integer");var rn=by;tc=rn;R.Integer=tc;rn.NAME="INTEGER";var Hw,wy=class wy extends rn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};o(wy,"Enumerated");var gi=wy;Hw=gi;R.Enumerated=Hw;gi.NAME="ENUMERATED";var _y=class _y extends Tr(Qe){constructor({valueDec:e=-1,isFirstSid:r=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=r}fromBER(e,r,n){if(!n)return r;let i=re.BufferSourceConverter.toUint8Array(e);if(!nn(this,i,r,n))return-1;let s=i.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let u=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)u[a]=this.valueHexView[a];return this.valueHexView=u,(s[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=yi(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(e){Ed();let r=BigInt(e).toString(2);for(;r.length%7;)r="0"+r;let n=new Uint8Array(r.length/7);for(let i=0;i<n.length;i++)n[i]=parseInt(r.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,s=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength-1;u++)s[u]=i[u]|128;return s[this.blockLength-1]=i[this.blockLength-1],s.buffer}let r=jn(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",lr;let n=new Uint8Array(r.byteLength);if(!e){let i=new Uint8Array(r),s=r.byteLength-1;for(let u=0;u<s;u++)n[u]=i[u]|128;n[s]=i[s]}return n}toString(){let e="";if(this.isHexOnly)e=re.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",r-=40):(e="2.",r-=80),e+=r.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};o(_y,"LocalSidValueBlock");var sc=_y;sc.NAME="sidBlock";var xy=class xy extends Qe{constructor({value:e=kt,...r}={}){super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,n){let i=r;for(;n>0;){let s=new sc;if(i=s.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=s.error,i;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return i}toBER(e){let r=[];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,lr;r.push(i)}return Xh(r)}fromString(e){this.value=[];let r=0,n=0,i="",s=!1;do if(n=e.indexOf(".",r),n===-1?i=e.substring(r):i=e.substring(r,n),r=n+1,s){let u=this.value[0],a=0;switch(u.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}let c=parseInt(i,10);if(isNaN(c))return;u.valueDec=c+a,s=!1}else{let u=new sc;if(i>Number.MAX_SAFE_INTEGER){Ed();let a=BigInt(i);u.valueBigInt=a}else if(u.valueDec=parseInt(i,10),isNaN(u.valueDec))return;this.value.length||(u.isFirstSid=!0,s=!0),this.value.push(u)}while(n!==-1)}toString(){let e="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),r?(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 r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};o(xy,"LocalObjectIdentifierValueBlock");var Bd=xy;Bd.NAME="ObjectIdentifierValueBlock";var Lw,Ay=class Ay extends Ue{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Bd),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};o(Ay,"ObjectIdentifier");var vi=Ay;Lw=vi;R.ObjectIdentifier=Lw;vi.NAME="OBJECT IDENTIFIER";var Sy=class Sy extends Tr(en){constructor({valueDec:e=0,...r}={}){super(r),this.valueDec=e}fromBER(e,r,n){if(n===0)return r;let i=re.BufferSourceConverter.toUint8Array(e);if(!nn(this,i,r,n))return-1;let s=i.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let u=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)u[a]=this.valueHexView[a];return this.valueHexView=u,(s[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=yi(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,s=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength-1;u++)s[u]=i[u]|128;return s[this.blockLength-1]=i[this.blockLength-1],s.buffer}let r=jn(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",lr;let n=new Uint8Array(r.byteLength);if(!e){let i=new Uint8Array(r),s=r.byteLength-1;for(let u=0;u<s;u++)n[u]=i[u]|128;n[s]=i[s]}return n.buffer}toString(){let e="";return this.isHexOnly?e=re.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};o(Sy,"LocalRelativeSidValueBlock");var uc=Sy;uc.NAME="relativeSidBlock";var ky=class ky extends Qe{constructor({value:e=kt,...r}={}){super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,n){let i=r;for(;n>0;){let s=new uc;if(i=s.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=s.error,i;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return i}toBER(e,r){let n=[];for(let i=0;i<this.value.length;i++){let s=this.value[i].toBER(e);if(s.byteLength===0)return this.error=this.value[i].error,lr;n.push(s)}return Xh(n)}fromString(e){this.value=[];let r=0,n=0,i="";do{n=e.indexOf(".",r),n===-1?i=e.substring(r):i=e.substring(r,n),r=n+1;let s=new uc;if(s.valueDec=parseInt(i,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let e="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),r&&(i=`{${i}}`),e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};o(ky,"LocalRelativeObjectIdentifierValueBlock");var Dd=ky;Dd.NAME="RelativeObjectIdentifierValueBlock";var Ww,Cy=class Cy extends Ue{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Dd),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};o(Cy,"RelativeObjectIdentifier");var ac=Cy;Ww=ac;R.RelativeObjectIdentifier=Ww;ac.NAME="RelativeObjectIdentifier";var Fw,Ey=class Ey extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};o(Ey,"Sequence");var it=Ey;Fw=it;R.Sequence=Fw;it.NAME="SEQUENCE";var Kw,Py=class Py extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};o(Py,"Set");var pt=Py;Kw=pt;R.Set=Kw;pt.NAME="SET";var Ty=class Ty extends Tr(Qe){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=kt}toJSON(){return{...super.toJSON(),value:this.value}}};o(Ty,"LocalStringValueBlock");var qd=Ty;qd.NAME="StringValueBlock";var Iy=class Iy extends qd{};o(Iy,"LocalSimpleStringValueBlock");var Md=Iy;Md.NAME="SimpleStringValueBlock";var Oy=class Oy extends nc{constructor({...e}={}){super(e,Md)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,re.BufferSourceConverter.toUint8Array(e))}fromString(e){let r=e.length,n=this.valueBlock.valueHexView=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);this.valueBlock.value=e}};o(Oy,"LocalSimpleStringBlock");var ht=Oy;ht.NAME="SIMPLE STRING";var Ry=class Ry extends ht{fromBuffer(e){this.valueBlock.valueHexView=re.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=re.Convert.ToUtf8String(e)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=re.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(re.Convert.FromUtf8String(e)),this.valueBlock.value=e}};o(Ry,"LocalUtf8StringValueBlock");var Ud=Ry;Ud.NAME="Utf8StringValueBlock";var Jw,jy=class jy extends Ud{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};o(jy,"Utf8String");var zt=jy;Jw=zt;R.Utf8String=Jw;zt.NAME="UTF8String";var Ny=class Ny extends ht{fromBuffer(e){this.valueBlock.value=re.Convert.ToUtf16String(e),this.valueBlock.valueHexView=re.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(re.Convert.FromUtf16String(e))}};o(Ny,"LocalBmpStringValueBlock");var $d=Ny;$d.NAME="BmpStringValueBlock";var zw,By=class By extends $d{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};o(By,"BmpString");var bi=By;zw=bi;R.BmpString=zw;bi.NAME="BMPString";var Dy=class Dy extends ht{fromBuffer(e){let r=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(r);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(r))}fromString(e){let r=e.length,n=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let i=0;i<r;i++){let s=jn(e.charCodeAt(i),8),u=new Uint8Array(s);if(u.length>4)continue;let a=4-u.length;for(let c=u.length-1;c>=0;c--)n[i*4+c+a]=u[c]}this.valueBlock.value=e}};o(Dy,"LocalUniversalStringValueBlock");var Vd=Dy;Vd.NAME="UniversalStringValueBlock";var Gw,qy=class qy extends Vd{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};o(qy,"UniversalString");var wi=qy;Gw=wi;R.UniversalString=Gw;wi.NAME="UniversalString";var Xw,My=class My extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};o(My,"NumericString");var _i=My;Xw=_i;R.NumericString=Xw;_i.NAME="NumericString";var Zw,Uy=class Uy extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};o(Uy,"PrintableString");var xi=Uy;Zw=xi;R.PrintableString=Zw;xi.NAME="PrintableString";var Qw,$y=class $y extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};o($y,"TeletexString");var Ai=$y;Qw=Ai;R.TeletexString=Qw;Ai.NAME="TeletexString";var Yw,Vy=class Vy extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};o(Vy,"VideotexString");var Si=Vy;Yw=Si;R.VideotexString=Yw;Si.NAME="VideotexString";var e_,Hy=class Hy extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};o(Hy,"IA5String");var ki=Hy;e_=ki;R.IA5String=e_;ki.NAME="IA5String";var t_,Ly=class Ly extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};o(Ly,"GraphicString");var Ci=Ly;t_=Ci;R.GraphicString=t_;Ci.NAME="GraphicString";var r_,Wy=class Wy extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};o(Wy,"VisibleString");var Nn=Wy;r_=Nn;R.VisibleString=r_;Nn.NAME="VisibleString";var n_,Fy=class Fy extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};o(Fy,"GeneralString");var Ei=Fy;n_=Ei;R.GeneralString=n_;Ei.NAME="GeneralString";var i_,Ky=class Ky extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};o(Ky,"CharacterString");var Pi=Ky;i_=Pi;R.CharacterString=i_;Pi.NAME="CharacterString";var o_,Jy=class Jy extends Nn{constructor({value:e,valueDate:r,...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)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,re.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),r=new ArrayBuffer(e.length),n=new Uint8Array(r);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return r}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 r=new Array(7);return r[0]=St(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=St(this.month,2),r[2]=St(this.day,2),r[3]=St(this.hour,2),r[4]=St(this.minute,2),r[5]=St(this.second,2),r[6]="Z",r.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}}};o(Jy,"UTCTime");var Bn=Jy;o_=Bn;R.UTCTime=o_;Bn.NAME="UTCTime";var s_,zy=class zy extends Bn{constructor(e={}){var r;super(e),(r=this.millisecond)!==null&&r!==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 r=!1,n="",i="",s=0,u,a=0,c=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),r=!0;else{let y=new Number(e[e.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(r){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 y=1,v=n.indexOf("+"),x="";if(v===-1&&(v=n.indexOf("-"),y=-1),v!==-1){if(x=n.substring(v+1),n=n.substring(0,v),x.length!==2&&x.length!==4)throw new Error("Wrong input string for conversion");let A=parseInt(x.substring(0,2),10);if(isNaN(A.valueOf()))throw new Error("Wrong input string for conversion");if(a=y*A,x.length===4){if(A=parseInt(x.substring(2,4),10),isNaN(A.valueOf()))throw new Error("Wrong input string for conversion");c=y*A}}}let d=n.indexOf(".");if(d===-1&&(d=n.indexOf(",")),d!==-1){let y=new Number(`0${n.substring(d)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),i=n.substring(0,d)}else i=n;switch(!0){case i.length===8:if(u=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:if(u=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case i.length===12:if(u=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case i.length===14:if(u=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}let p=u.exec(i);if(p===null)throw new Error("Wrong input string for conversion");for(let y=1;y<p.length;y++)switch(y){case 1:this.year=parseInt(p[y],10);break;case 2:this.month=parseInt(p[y],10);break;case 3:this.day=parseInt(p[y],10);break;case 4:this.hour=parseInt(p[y],10)+a;break;case 5:this.minute=parseInt(p[y],10)+c;break;case 6:this.second=parseInt(p[y],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){let y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let r=[];return r.push(St(this.year,4)),r.push(St(this.month,2)),r.push(St(this.day,2)),r.push(St(this.hour,2)),r.push(St(this.minute,2)),r.push(St(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(St(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};o(zy,"GeneralizedTime");var Ti=zy;s_=Ti;R.GeneralizedTime=s_;Ti.NAME="GeneralizedTime";var u_,Gy=class Gy extends zt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};o(Gy,"DATE");var cc=Gy;u_=cc;R.DATE=u_;cc.NAME="DATE";var a_,Xy=class Xy extends zt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};o(Xy,"TimeOfDay");var fc=Xy;a_=fc;R.TimeOfDay=a_;fc.NAME="TimeOfDay";var c_,Zy=class Zy extends zt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};o(Zy,"DateTime");var dc=Zy;c_=dc;R.DateTime=c_;dc.NAME="DateTime";var f_,Qy=class Qy extends zt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};o(Qy,"Duration");var lc=Qy;f_=lc;R.Duration=f_;lc.NAME="Duration";var d_,Yy=class Yy extends zt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};o(Yy,"TIME");var pc=Yy;d_=pc;R.TIME=d_;pc.NAME="TIME";var e0=class e0{constructor({name:e=kt,optional:r=!1}={}){this.name=e,this.optional=r}};o(e0,"Any");var Pr=e0,t0=class t0 extends Pr{constructor({value:e=[],...r}={}){super(r),this.value=e}};o(t0,"Choice");var No=t0,r0=class r0 extends Pr{constructor({value:e=new Pr,local:r=!1,...n}={}){super(n),this.value=e,this.local=r}};o(r0,"Repeated");var Ii=r0,n0=class n0{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=re.BufferSourceConverter.toUint8Array(e)}constructor({data:e=Hd}={}){this.dataView=re.BufferSourceConverter.toUint8Array(e)}fromBER(e,r,n){let i=r+n;return this.dataView=re.BufferSourceConverter.toUint8Array(e).subarray(r,i),i}toBER(e){return this.dataView.slice().buffer}};o(n0,"RawData");var Gh=n0;function Yr(t,e,r){if(r instanceof No){for(let s of r.value)if(Yr(t,e,s).verified)return{verified:!0,result:t};{let s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(zh)&&(s.name=r.name),s}}if(r instanceof Pr)return r.hasOwnProperty(zh)&&(t[r.name]=e),{verified:!0,result:t};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(m5 in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(w5 in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(_5 in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let n=r.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(g5)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:t};if(r.idBlock.hasOwnProperty(v5)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:t};if(r.idBlock.hasOwnProperty(b5)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:t};if(!(y5 in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:t};if(r.idBlock.isHexOnly){if(!(Iw in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let s=r.idBlock.valueHexView,u=e.idBlock.valueHexView;if(s.length!==u.length)return{verified:!1,result:t};for(let a=0;a<s.length;a++)if(s[a]!==u[1])return{verified:!1,result:t}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,kt),r.name&&(t[r.name]=e)),r instanceof R.Constructed){let s=0,u={verified:!1,result:{error:"Unknown error"}},a=r.valueBlock.value.length;if(a>0&&r.valueBlock.value[0]instanceof Ii&&(a=e.valueBlock.value.length),a===0)return{verified:!0,result:t};if(e.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{verified:!0,result:t}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,kt),r.name&&delete t[r.name]),t.error="Inconsistent object length",{verified:!1,result:t})}for(let c=0;c<a;c++)if(c-s>=e.valueBlock.value.length){if(r.valueBlock.value[c].optional===!1){let d={verified:!1,result:t};return t.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,kt),r.name&&(delete t[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Ii){if(u=Yr(t,e.valueBlock.value[c],r.valueBlock.value[0].value),u.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,kt),r.name&&delete t[r.name]),u;if(zh in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};x5 in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=e:d=t,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(e.valueBlock.value[c])}}else if(u=Yr(t,e.valueBlock.value[c-s],r.valueBlock.value[c]),u.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,kt),r.name&&delete t[r.name]),u;if(u.verified===!1){let c={verified:!1,result:t};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,kt),r.name&&(delete t[r.name],c.name=r.name)),c}return{verified:!0,result:t}}if(r.primitiveSchema&&Iw in e.valueBlock){let s=Bo(e.valueBlock.valueHexView);if(s.offset===-1){let u={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,kt),r.name&&(delete t[r.name],u.name=r.name)),u}return Yr(t,s.result,r.primitiveSchema)}return{verified:!0,result:t}}o(Yr,"compareSchema");function E5(t,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let r=Bo(re.BufferSourceConverter.toUint8Array(t));return r.offset===-1?{verified:!1,result:r.result}:Yr(r.result,r.result,e)}o(E5,"verifySchema");var g;(function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice"})(g||(g={}));var h;(function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null"})(h||(h={}));var i0=kr(Qr());var o0=class o0{constructor(e,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(i0.BufferSourceConverter.isBufferSource(e))this.unusedBits=r,this.value=i0.BufferSourceConverter.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof dr))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new dr({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new dr({name:e})}toNumber(){let e="",r=new Uint8Array(this.value);for(let n of r)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 r=e.toString(2),n=r.length+7>>3;this.unusedBits=(n<<3)-r.length;let i=new Uint8Array(n);r=r.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)i[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=i.buffer}};o(o0,"BitString");var Or=o0;var s0=kr(Qr());var u0=class u0{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):s0.BufferSourceConverter.isBufferSource(e)?this.buffer=s0.BufferSourceConverter.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof fr))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new fr({valueHex:this.buffer})}toSchema(e){return new fr({name:e})}};o(u0,"OctetString");var V=u0;var P5={fromASN:o(t=>t instanceof cr?null:t.valueBeforeDecodeView,"fromASN"),toASN:o(t=>{if(t===null)return new cr;let e=on(t);if(e.result.error)throw new Error(e.result.error);return e.result},"toASN")},T5={fromASN:o(t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,"fromASN"),toASN:o(t=>new rn({value:+t}),"toASN")},I5={fromASN:o(t=>t.valueBlock.valueDec,"fromASN"),toASN:o(t=>new gi({value:t}),"toASN")},ne={fromASN:o(t=>t.valueBlock.valueHexView,"fromASN"),toASN:o(t=>new rn({valueHex:t}),"toASN")};var O5={fromASN:o(t=>t.valueBlock.valueHexView,"fromASN"),toASN:o(t=>new dr({valueHex:t}),"toASN")},R5={fromASN:o(t=>t.valueBlock.toString(),"fromASN"),toASN:o(t=>new vi({value:t}),"toASN")},j5={fromASN:o(t=>t.valueBlock.value,"fromASN"),toASN:o(t=>new mi({value:t}),"toASN")},Do={fromASN:o(t=>t.valueBlock.valueHexView,"fromASN"),toASN:o(t=>new fr({valueHex:t}),"toASN")},l_={fromASN:o(t=>new V(t.getValue()),"fromASN"),toASN:o(t=>t.toASN(),"toASN")};function Gt(t){return{fromASN:o(e=>e.valueBlock.value,"fromASN"),toASN:o(e=>new t({value:e}),"toASN")}}o(Gt,"createStringConverter");var a0=Gt(zt),N5=Gt(bi),B5=Gt(wi),D5=Gt(_i),q5=Gt(xi),M5=Gt(Ai),U5=Gt(Si),$5=Gt(ki),V5=Gt(Ci),H5=Gt(Nn),L5=Gt(Ei),W5=Gt(Pi),F5={fromASN:o(t=>t.toDate(),"fromASN"),toASN:o(t=>new Bn({valueDate:t}),"toASN")},K5={fromASN:o(t=>t.toDate(),"fromASN"),toASN:o(t=>new Ti({valueDate:t}),"toASN")},J5={fromASN:o(()=>null,"fromASN"),toASN:o(()=>new cr,"toASN")};function Dn(t){switch(t){case h.Any:return P5;case h.BitString:return O5;case h.BmpString:return N5;case h.Boolean:return j5;case h.CharacterString:return W5;case h.Enumerated:return I5;case h.GeneralString:return L5;case h.GeneralizedTime:return K5;case h.GraphicString:return V5;case h.IA5String:return $5;case h.Integer:return T5;case h.Null:return J5;case h.NumericString:return D5;case h.ObjectIdentifier:return R5;case h.OctetString:return Do;case h.PrintableString:return q5;case h.TeletexString:return M5;case h.UTCTime:return F5;case h.UniversalString:return B5;case h.Utf8String:return a0;case h.VideotexString:return U5;case h.VisibleString:return H5;default:return null}}o(Dn,"defaultConverter");function Xt(t){return typeof t=="function"&&t.prototype?t.prototype.toASN&&t.prototype.fromASN?!0:Xt(t.prototype):!!(t&&typeof t=="object"&&"toASN"in t&&"fromASN"in t)}o(Xt,"isConvertible");function f0(t){var e;if(t){let r=Object.getPrototypeOf(t);return((e=r?.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:f0(r)}return!1}o(f0,"isTypeOfArray");function p_(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)if(r[i]!==n[i])return!1;return!0}o(p_,"isArrayEqual");var d0=class d0{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,r=!1){let n=this.items.get(e);if(!n)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(r&&!n.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(e){let r=this.get(e);r.schema||(r.schema=this.create(e,!0))}createDefault(e){let r={type:g.Sequence,items:{}},n=this.findParentSchema(e);return n&&(Object.assign(r,n),r.items=Object.assign({},r.items,n.items)),r}create(e,r){let n=this.items.get(e)||this.createDefault(e),i=[];for(let s in n.items){let u=n.items[s],a=r?s:"",c;if(typeof u.type=="number"){let p=h[u.type],y=Ir[p];if(!y)throw new Error(`Cannot get ASN1 class by name '${p}'`);c=new y({name:a})}else Xt(u.type)?c=new u.type().toSchema(a):u.optional?this.get(u.type).type===g.Choice?c=new Pr({name:a}):(c=this.create(u.type,!1),c.name=a):c=new Pr({name:a});let d=!!u.optional||u.defaultValue!==void 0;if(u.repeated){c.name="";let p=u.repeated==="set"?pt:it;c=new p({name:"",value:[new Ii({name:a,value:c})]})}if(u.context!==null&&u.context!==void 0)if(u.implicit)if(typeof u.type=="number"||Xt(u.type)){let p=u.repeated?$e:tn;i.push(new p({name:a,optional:d,idBlock:{tagClass:3,tagNumber:u.context}}))}else{this.cache(u.type);let p=!!u.repeated,y=p?c:this.get(u.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,i.push(new $e({name:p?"":a,optional:d,idBlock:{tagClass:3,tagNumber:u.context},value:y}))}else i.push(new $e({optional:d,idBlock:{tagClass:3,tagNumber:u.context},value:[c]}));else c.optional=d,i.push(c)}switch(n.type){case g.Sequence:return new it({value:i,name:""});case g.Set:return new pt({value:i,name:""});case g.Choice:return new No({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,r){return this.items.set(e,r),this}findParentSchema(e){let r=Object.getPrototypeOf(e);return r?this.items.get(r)||this.findParentSchema(r):null}};o(d0,"AsnSchemaStorage");var Ld=d0;var Ve=new Ld;var b=o(t=>e=>{let r;Ve.has(e)?r=Ve.get(e):(r=Ve.createDefault(e),Ve.set(e,r)),Object.assign(r,t)},"AsnType");var l=o(t=>(e,r)=>{let n;Ve.has(e.constructor)?n=Ve.get(e.constructor):(n=Ve.createDefault(e.constructor),Ve.set(e.constructor,n));let i=Object.assign({},t);if(typeof i.type=="number"&&!i.converter){let s=Dn(t.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);i.converter=s}i.raw=t.raw,n.items[r]=i},"AsnProp");var l0=class l0 extends Error{constructor(){super(...arguments),this.schemas=[]}};o(l0,"AsnSchemaValidationError");var qn=l0;var p0=class p0{static parse(e,r){let n=on(e);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r)}static fromASN(e,r){try{if(Xt(r))return new r().fromASN(e);let n=Ve.get(r);Ve.cache(r);let i=n.schema,s=this.handleChoiceTypes(e,n,r,i);if(s?.result)return s.result;s?.targetSchema&&(i=s.targetSchema);let u=this.handleSequenceTypes(e,n,r,i),a=new r;return f0(r)?this.handleArrayTypes(e,n,r):(this.processSchemaItems(n,u,a),a)}catch(n){throw n instanceof qn&&n.schemas.push(r.name),n}}static handleChoiceTypes(e,r,n,i){if(e.constructor===$e&&r.type===g.Choice&&e.idBlock.tagClass===3)for(let s in r.items){let u=r.items[s];if(u.context===e.idBlock.tagNumber&&u.implicit&&typeof u.type=="function"&&Ve.has(u.type)){let a=Ve.get(u.type);if(a&&a.type===g.Sequence){let c=new it;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in c.valueBlock){c.valueBlock.value=e.valueBlock.value;let d=this.fromASN(c,u.type),p=new n;return p[s]=d,{result:p}}}}}else if(e.constructor===$e&&r.type!==g.Choice){let s=new $e({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:r.schema.valueBlock.value});for(let u in r.items)delete e[u];return{targetSchema:s}}return null}static handleSequenceTypes(e,r,n,i){if(r.type===g.Sequence){let s=Yr({},e,i);if(!s.verified)throw new qn(`Data does not match to ${n.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{let s=Yr({},e,i);if(!s.verified)throw new qn(`Data does not match to ${n.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,r,n){let i=e.slice(r);if(i.length===1&&i[0].constructor.name==="Sequence"){let s=i[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(i=s.valueBlock.value)}if(typeof n.type=="number"){let s=Dn(n.type);if(!s)throw new Error(`No converter for ASN.1 type ${n.type}`);return i.filter(u=>u&&u.valueBlock).map(u=>{try{return s.fromASN(u)}catch{return}}).filter(u=>u!==void 0)}else return i.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,n.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,r){let n=Dn(r.type);if(!n)throw new Error(`No converter for ASN.1 type ${r.type}`);return n.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&Ve.has(e.type)&&Ve.get(e.type).type===g.Choice}static processOptionalChoiceField(e,r){try{return{processed:!0,value:this.fromASN(e,r.type)}}catch(n){if(n instanceof qn&&/Wrong values for Choice type/.test(n.message))return{processed:!1};throw n}}static handleArrayTypes(e,r,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=r.itemType;if(typeof i=="number"){let s=Dn(i);if(!s)throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`);return n.from(e.valueBlock.value,u=>s.fromASN(u))}else return n.from(e.valueBlock.value,s=>this.fromASN(s,i))}static processSchemaItems(e,r,n){for(let i in e.items){let s=r.result[i];if(!s)continue;let u=e.items[i],a=u.type,c;typeof a=="number"||Xt(a)?c=this.processPrimitiveSchemaItem(s,u,a):c=this.processComplexSchemaItem(s,u,a),c&&typeof c=="object"&&"value"in c&&"raw"in c?(n[i]=c.value,n[`${i}Raw`]=c.raw):n[i]=c}}static processPrimitiveSchemaItem(e,r,n){var i;let s=(i=r.converter)!==null&&i!==void 0?i:Xt(n)?new n:null;if(!s)throw new Error("Converter is empty");return r.repeated?this.processRepeatedPrimitiveItem(e,r,s):this.processSinglePrimitiveItem(e,r,n,s)}static processRepeatedPrimitiveItem(e,r,n){if(r.implicit){let i=r.repeated==="sequence"?it:pt,s=new i;s.valueBlock=e.valueBlock;let u=on(s.toBER(!1));if(u.offset===-1)throw new Error(`Cannot parse the child item. ${u.result.error}`);if(!("value"in u.result.valueBlock&&Array.isArray(u.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let a=u.result.valueBlock.value;return Array.from(a,c=>n.fromASN(c))}else return Array.from(e,i=>n.fromASN(i))}static processSinglePrimitiveItem(e,r,n,i){let s=e;if(r.implicit){let u;if(Xt(n))u=new n().toSchema("");else{let a=h[n],c=Ir[a];if(!c)throw new Error(`Cannot get '${a}' class from asn1js module`);u=new c}u.valueBlock=s.valueBlock,s=on(u.toBER(!1)).result}return i.fromASN(s)}static processComplexSchemaItem(e,r,n){if(r.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,r,n);if(this.isOptionalChoiceField(r))try{return this.fromASN(i,n)}catch(s){if(s instanceof qn&&/Wrong values for Choice type/.test(s.message))return;throw s}else{let s=this.fromASN(i,n);return r.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,r,n){if(r.implicit&&typeof r.context=="number"){let i=Ve.get(n);if(i.type===g.Sequence){let s=new it;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(i.type===g.Set){let s=new pt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}};o(p0,"AsnParser");var hc=p0;var Wd=class Wd{static serialize(e){return e instanceof Ue?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&Xt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let r=e.constructor,n=Ve.get(r);Ve.cache(r);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 u=Dn(n.itemType);if(!u)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);i=e.map(a=>u.toASN(a))}else i=e.map(u=>this.toAsnItem({type:n.itemType},"[]",r,u))}else for(let u in n.items){let a=n.items[u],c=e[u];if(c===void 0||a.defaultValue===c||typeof a.defaultValue=="object"&&typeof c=="object"&&p_(this.serialize(a.defaultValue),this.serialize(c)))continue;let d=Wd.toAsnItem(a,u,r,c);if(typeof a.context=="number")if(a.implicit)if(!a.repeated&&(typeof a.type=="number"||Xt(a.type))){let p={};p.valueHex=d instanceof cr?d.valueBeforeDecodeView:d.valueBlock.toBER(),i.push(new tn({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},...p}))}else i.push(new $e({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:d.valueBlock.value}));else i.push(new $e({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:[d]}));else a.repeated?i=i.concat(d):i.push(d)}let s;switch(n.type){case g.Sequence:s=new it({value:i});break;case g.Set:s=new pt({value:i});break;case g.Choice:if(!i[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=i[0];break}return s}static toAsnItem(e,r,n,i){let s;if(typeof e.type=="number"){let u=e.converter;if(!u)throw new Error(`Property '${r}' doesn't have converter for type ${h[e.type]} in schema '${n.name}'`);if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let a=Array.from(i,d=>u.toASN(d)),c=e.repeated==="sequence"?it:pt;s=new c({value:a})}else s=u.toASN(i)}else if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let u=Array.from(i,c=>this.toASN(c)),a=e.repeated==="sequence"?it:pt;s=new a({value:u})}else s=this.toASN(i);return s}};o(Wd,"AsnSerializer");var yc=Wd;var h0=class h0 extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(let r of e)this.push(r)}}};o(h0,"AsnArray");var U=h0;var y0=kr(Qr());var Fd=class Fd{static serialize(e){return yc.serialize(e)}static parse(e,r){return hc.parse(e,r)}static toString(e){let r=y0.BufferSourceConverter.isBufferSource(e)?y0.BufferSourceConverter.toArrayBuffer(e):Fd.serialize(e),n=on(r);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}};o(Fd,"AsnConvert");var P=Fd;function f(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(u=t[a])&&(s=(i<3?u(s):i>3?u(e,r,s):u(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}o(f,"__decorate");function X(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}o(X,"__classPrivateFieldGet");function _e(t,e,r,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"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}o(_e,"__classPrivateFieldSet");var h_=kr(Qr());var m0=class m0{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let r=e.split(".");if(r.length!==4)throw new Error("Invalid IPv4 address");return r.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,s)=>{let u=parseInt(s,16);if(isNaN(u)||u<0||u>65535)throw new Error("Invalid IPv6 address part");return i.push(u>>8&255),i.push(u&255),i},[])}static expandIPv6(e){if(!e.includes("::"))return e;let r=e.split("::");if(r.length>2)throw new Error("Invalid IPv6 address");let n=r[0]?r[0].split(":"):[],i=r[1]?r[1].split(":"):[],s=8-(n.length+i.length);if(s<0)throw new Error("Invalid IPv6 address");return[...n,...Array(s).fill("0"),...i].join(":")}static formatIPv6(e){let r=[];for(let n=0;n<16;n+=2)r.push((e[n]<<8|e[n+1]).toString(16));return this.compressIPv6(r.join(":"))}static compressIPv6(e){let r=e.split(":"),n=-1,i=0,s=-1,u=0;for(let a=0;a<r.length;a++)r[a]==="0"?(s===-1&&(s=a),u++):(u>i&&(n=s,i=u),s=-1,u=0);if(u>i&&(n=s,i=u),i>1){let a=r.slice(0,n).join(":"),c=r.slice(n+i).join(":");return`${a}::${c}`}return e}static parseCIDR(e){let[r,n]=e.split("/"),i=parseInt(n,10);if(this.isIPv4(r)){if(i<0||i>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(r),i]}else{if(i<0||i>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(r),i]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;let r=parseInt(e.slice(8),16).toString(2).split("").reduce((i,s)=>i+ +s,0),n=e.slice(0,8).replace(/(.{2})/g,i=>`${parseInt(i,16)}.`);return n=n.slice(0,-1),`${n}/${r}`}static toString(e){let r=new Uint8Array(e);if(r.length===4)return Array.from(r).join(".");if(r.length===16)return this.formatIPv6(r);if(r.length===8||r.length===32){let n=r.length/2,i=r.slice(0,n),s=r.slice(n);if(r.every(c=>c===0))return r.length===8?"0.0.0.0/0":"::/0";let a=s.reduce((c,d)=>c+(d.toString(2).match(/1/g)||[]).length,0);return r.length===8?`${Array.from(i).join(".")}/${a}`:`${this.formatIPv6(i)}/${a}`}return this.decodeIP(h_.Convert.ToHex(e))}static fromString(e){if(e.includes("/")){let[n,i]=this.parseCIDR(e),s=new Uint8Array(n.length),u=i;for(let c=0;c<s.length;c++)u>=8?(s[c]=255,u-=8):u>0&&(s[c]=255<<8-u,u=0);let a=new Uint8Array(n.length*2);return a.set(n,0),a.set(s,n.length),a.buffer}let r=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(r).buffer}};o(m0,"IpConverter");var mc=m0;var y_=kr(Qr());var g0,v0,b0,qo,He=(qo=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}},o(qo,"DirectoryString"),qo);f([l({type:h.TeletexString})],He.prototype,"teletexString",void 0);f([l({type:h.PrintableString})],He.prototype,"printableString",void 0);f([l({type:h.UniversalString})],He.prototype,"universalString",void 0);f([l({type:h.Utf8String})],He.prototype,"utf8String",void 0);f([l({type:h.BmpString})],He.prototype,"bmpString",void 0);He=f([b({type:g.Choice})],He);var Mo,Ho=(Mo=class extends He{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?y_.Convert.ToHex(this.anyValue):super.toString())}},o(Mo,"AttributeValue"),Mo);f([l({type:h.IA5String})],Ho.prototype,"ia5String",void 0);f([l({type:h.Any})],Ho.prototype,"anyValue",void 0);Ho=f([b({type:g.Choice})],Ho);var _0=class _0{constructor(e={}){this.type="",this.value=new Ho,Object.assign(this,e)}};o(_0,"AttributeTypeAndValue");var Oi=_0;f([l({type:h.ObjectIdentifier})],Oi.prototype,"type",void 0);f([l({type:Ho})],Oi.prototype,"value",void 0);var Uo,Mn=g0=(Uo=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,g0.prototype)}},o(Uo,"RelativeDistinguishedName"),Uo);Mn=g0=f([b({type:g.Set,itemType:Oi})],Mn);var $o,w0=v0=($o=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,v0.prototype)}},o($o,"RDNSequence"),$o);w0=v0=f([b({type:g.Sequence,itemType:Mn})],w0);var Vo,be=b0=(Vo=class extends w0{constructor(e){super(e),Object.setPrototypeOf(this,b0.prototype)}},o(Vo,"Name"),Vo);be=b0=f([b({type:g.Sequence})],be);var z5={fromASN:o(t=>mc.toString(Do.fromASN(t)),"fromASN"),toASN:o(t=>Do.toASN(mc.fromString(t)),"toASN")},x0=class x0{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}};o(x0,"OtherName");var Un=x0;f([l({type:h.ObjectIdentifier})],Un.prototype,"typeId",void 0);f([l({type:h.Any,context:0})],Un.prototype,"value",void 0);var A0=class A0{constructor(e={}){this.partyName=new He,Object.assign(this,e)}};o(A0,"EDIPartyName");var gc=A0;f([l({type:He,optional:!0,context:0,implicit:!0})],gc.prototype,"nameAssigner",void 0);f([l({type:He,context:1,implicit:!0})],gc.prototype,"partyName",void 0);var Lo,W=(Lo=class{constructor(e={}){Object.assign(this,e)}},o(Lo,"GeneralName"),Lo);f([l({type:Un,context:0,implicit:!0})],W.prototype,"otherName",void 0);f([l({type:h.IA5String,context:1,implicit:!0})],W.prototype,"rfc822Name",void 0);f([l({type:h.IA5String,context:2,implicit:!0})],W.prototype,"dNSName",void 0);f([l({type:h.Any,context:3,implicit:!0})],W.prototype,"x400Address",void 0);f([l({type:be,context:4,implicit:!1})],W.prototype,"directoryName",void 0);f([l({type:gc,context:5})],W.prototype,"ediPartyName",void 0);f([l({type:h.IA5String,context:6,implicit:!0})],W.prototype,"uniformResourceIdentifier",void 0);f([l({type:h.OctetString,context:7,implicit:!0,converter:z5})],W.prototype,"iPAddress",void 0);f([l({type:h.ObjectIdentifier,context:8,implicit:!0})],W.prototype,"registeredID",void 0);W=f([b({type:g.Choice})],W);var $n="1.3.6.1.5.5.7",Vn=`${$n}.1`,m_=`${$n}.2`,Ri=`${$n}.3`,Kd=`${$n}.48`,XN=`${m_}.1`,ZN=`${m_}.2`,S0=`${Kd}.1`,k0=`${Kd}.2`,C0=`${Kd}.3`,E0=`${Kd}.5`,z="2.5.29";var P0,Jd=`${Vn}.1`,T0=class T0{constructor(e={}){this.accessMethod="",this.accessLocation=new W,Object.assign(this,e)}};o(T0,"AccessDescription");var sn=T0;f([l({type:h.ObjectIdentifier})],sn.prototype,"accessMethod",void 0);f([l({type:W})],sn.prototype,"accessLocation",void 0);var Wo,ji=P0=(Wo=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,P0.prototype)}},o(Wo,"AuthorityInfoAccessSyntax"),Wo);ji=P0=f([b({type:g.Sequence,itemType:sn})],ji);var zd=`${z}.35`,I0=class I0 extends V{};o(I0,"KeyIdentifier");var Ni=I0,O0=class O0{constructor(e={}){e&&Object.assign(this,e)}};o(O0,"AuthorityKeyIdentifier");var Rr=O0;f([l({type:Ni,context:0,optional:!0,implicit:!0})],Rr.prototype,"keyIdentifier",void 0);f([l({type:W,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Rr.prototype,"authorityCertIssuer",void 0);f([l({type:h.Integer,context:2,optional:!0,implicit:!0,converter:ne})],Rr.prototype,"authorityCertSerialNumber",void 0);var Gd=`${z}.19`,R0=class R0{constructor(e={}){this.cA=!1,Object.assign(this,e)}};o(R0,"BasicConstraints");var Bi=R0;f([l({type:h.Boolean,defaultValue:!1})],Bi.prototype,"cA",void 0);f([l({type:h.Integer,optional:!0})],Bi.prototype,"pathLenConstraint",void 0);var j0,Fo,xe=j0=(Fo=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,j0.prototype)}},o(Fo,"GeneralNames"),Fo);xe=j0=f([b({type:g.Sequence,itemType:W})],xe);var N0,G5=`${z}.29`,Ko,g_=N0=(Ko=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,N0.prototype)}},o(Ko,"CertificateIssuer"),Ko);g_=N0=f([b({type:g.Sequence})],g_);var B0,Zd=`${z}.32`,O7=`${Zd}.0`,Jo,un=(Jo=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}},o(Jo,"DisplayText"),Jo);f([l({type:h.IA5String})],un.prototype,"ia5String",void 0);f([l({type:h.VisibleString})],un.prototype,"visibleString",void 0);f([l({type:h.BmpString})],un.prototype,"bmpString",void 0);f([l({type:h.Utf8String})],un.prototype,"utf8String",void 0);un=f([b({type:g.Choice})],un);var D0=class D0{constructor(e={}){this.organization=new un,this.noticeNumbers=[],Object.assign(this,e)}};o(D0,"NoticeReference");var vc=D0;f([l({type:un})],vc.prototype,"organization",void 0);f([l({type:h.Integer,repeated:"sequence"})],vc.prototype,"noticeNumbers",void 0);var q0=class q0{constructor(e={}){Object.assign(this,e)}};o(q0,"UserNotice");var bc=q0;f([l({type:vc,optional:!0})],bc.prototype,"noticeRef",void 0);f([l({type:un,optional:!0})],bc.prototype,"explicitText",void 0);var zo,Xd=(zo=class{constructor(e={}){Object.assign(this,e)}},o(zo,"Qualifier"),zo);f([l({type:h.IA5String})],Xd.prototype,"cPSuri",void 0);f([l({type:bc})],Xd.prototype,"userNotice",void 0);Xd=f([b({type:g.Choice})],Xd);var M0=class M0{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}};o(M0,"PolicyQualifierInfo");var wc=M0;f([l({type:h.ObjectIdentifier})],wc.prototype,"policyQualifierId",void 0);f([l({type:h.Any})],wc.prototype,"qualifier",void 0);var U0=class U0{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}};o(U0,"PolicyInformation");var Di=U0;f([l({type:h.ObjectIdentifier})],Di.prototype,"policyIdentifier",void 0);f([l({type:wc,repeated:"sequence",optional:!0})],Di.prototype,"policyQualifiers",void 0);var Go,_c=B0=(Go=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,B0.prototype)}},o(Go,"CertificatePolicies"),Go);_c=B0=f([b({type:g.Sequence,itemType:Di})],_c);var q7=`${z}.20`,Xo,xc=(Xo=class{constructor(e=0){this.value=e}},o(Xo,"CRLNumber"),Xo);f([l({type:h.Integer})],xc.prototype,"value",void 0);xc=f([b({type:g.Choice})],xc);var W7=`${z}.27`,Zo,v_=(Zo=class extends xc{},o(Zo,"BaseCRLNumber"),Zo);v_=f([b({type:g.Choice})],v_);var $0,Qd=`${z}.31`,pr;(function(t){t[t.unused=1]="unused",t[t.keyCompromise=2]="keyCompromise",t[t.cACompromise=4]="cACompromise",t[t.affiliationChanged=8]="affiliationChanged",t[t.superseded=16]="superseded",t[t.cessationOfOperation=32]="cessationOfOperation",t[t.certificateHold=64]="certificateHold",t[t.privilegeWithdrawn=128]="privilegeWithdrawn",t[t.aACompromise=256]="aACompromise"})(pr||(pr={}));var V0=class V0 extends Or{toJSON(){let e=[],r=this.toNumber();return r&pr.aACompromise&&e.push("aACompromise"),r&pr.affiliationChanged&&e.push("affiliationChanged"),r&pr.cACompromise&&e.push("cACompromise"),r&pr.certificateHold&&e.push("certificateHold"),r&pr.cessationOfOperation&&e.push("cessationOfOperation"),r&pr.keyCompromise&&e.push("keyCompromise"),r&pr.privilegeWithdrawn&&e.push("privilegeWithdrawn"),r&pr.superseded&&e.push("superseded"),r&pr.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}};o(V0,"Reason");var Ac=V0,Qo,an=(Qo=class{constructor(e={}){Object.assign(this,e)}},o(Qo,"DistributionPointName"),Qo);f([l({type:W,context:0,repeated:"sequence",implicit:!0})],an.prototype,"fullName",void 0);f([l({type:Mn,context:1,implicit:!0})],an.prototype,"nameRelativeToCRLIssuer",void 0);an=f([b({type:g.Choice})],an);var H0=class H0{constructor(e={}){Object.assign(this,e)}};o(H0,"DistributionPoint");var jr=H0;f([l({type:an,context:0,optional:!0})],jr.prototype,"distributionPoint",void 0);f([l({type:Ac,context:1,optional:!0,implicit:!0})],jr.prototype,"reasons",void 0);f([l({type:W,context:2,optional:!0,repeated:"sequence",implicit:!0})],jr.prototype,"cRLIssuer",void 0);var Yo,Hn=$0=(Yo=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,$0.prototype)}},o(Yo,"CRLDistributionPoints"),Yo);Hn=$0=f([b({type:g.Sequence,itemType:jr})],Hn);var L0,iB=`${z}.46`,es,b_=L0=(es=class extends Hn{constructor(e){super(e),Object.setPrototypeOf(this,L0.prototype)}},o(es,"FreshestCRL"),es);b_=L0=f([b({type:g.Sequence,itemType:jr})],b_);var lB=`${z}.28`,qi=class qi{constructor(e={}){this.onlyContainsUserCerts=qi.ONLY,this.onlyContainsCACerts=qi.ONLY,this.indirectCRL=qi.ONLY,this.onlyContainsAttributeCerts=qi.ONLY,Object.assign(this,e)}};o(qi,"IssuingDistributionPoint");var qt=qi;qt.ONLY=!1;f([l({type:an,context:0,optional:!0})],qt.prototype,"distributionPoint",void 0);f([l({type:h.Boolean,context:1,defaultValue:qt.ONLY,implicit:!0})],qt.prototype,"onlyContainsUserCerts",void 0);f([l({type:h.Boolean,context:2,defaultValue:qt.ONLY,implicit:!0})],qt.prototype,"onlyContainsCACerts",void 0);f([l({type:Ac,context:3,optional:!0,implicit:!0})],qt.prototype,"onlySomeReasons",void 0);f([l({type:h.Boolean,context:4,defaultValue:qt.ONLY,implicit:!0})],qt.prototype,"indirectCRL",void 0);f([l({type:h.Boolean,context:5,defaultValue:qt.ONLY,implicit:!0})],qt.prototype,"onlyContainsAttributeCerts",void 0);var w_=`${z}.21`,Sc;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(Sc||(Sc={}));var ts,kc=(ts=class{constructor(e=Sc.unspecified){this.reason=Sc.unspecified,this.reason=e}toJSON(){return Sc[this.reason]}toString(){return this.toJSON()}},o(ts,"CRLReason"),ts);f([l({type:h.Enumerated})],kc.prototype,"reason",void 0);kc=f([b({type:g.Choice})],kc);var W0,Yd=`${z}.37`,rs,Cc=W0=(rs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,W0.prototype)}},o(rs,"ExtendedKeyUsage"),rs);Cc=W0=f([b({type:g.Sequence,itemType:h.ObjectIdentifier})],Cc);var AB=`${Yd}.0`,__=`${Ri}.1`,x_=`${Ri}.2`,A_=`${Ri}.3`,S_=`${Ri}.4`,k_=`${Ri}.8`,C_=`${Ri}.9`;var TB=`${z}.54`,ns,F0=(ns=class{constructor(e=new ArrayBuffer(0)){this.value=e}},o(ns,"InhibitAnyPolicy"),ns);f([l({type:h.Integer,converter:ne})],F0.prototype,"value",void 0);F0=f([b({type:g.Choice})],F0);var E_=`${z}.24`,is,Ec=(is=class{constructor(e){this.value=new Date,e&&(this.value=e)}},o(is,"InvalidityDate"),is);f([l({type:h.GeneralizedTime})],Ec.prototype,"value",void 0);Ec=f([b({type:g.Choice})],Ec);var K0,J0=`${z}.18`,os,P_=K0=(os=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,K0.prototype)}},o(os,"IssueAlternativeName"),os);P_=K0=f([b({type:g.Sequence})],P_);var el=`${z}.15`,hr;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(hr||(hr={}));var z0=class z0 extends Or{toJSON(){let e=this.toNumber(),r=[];return e&hr.cRLSign&&r.push("crlSign"),e&hr.dataEncipherment&&r.push("dataEncipherment"),e&hr.decipherOnly&&r.push("decipherOnly"),e&hr.digitalSignature&&r.push("digitalSignature"),e&hr.encipherOnly&&r.push("encipherOnly"),e&hr.keyAgreement&&r.push("keyAgreement"),e&hr.keyCertSign&&r.push("keyCertSign"),e&hr.keyEncipherment&&r.push("keyEncipherment"),e&hr.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}};o(z0,"KeyUsage");var ss=z0;var G0,ZB=`${z}.30`,X0=class X0{constructor(e={}){this.base=new W,this.minimum=0,Object.assign(this,e)}};o(X0,"GeneralSubtree");var as=X0;f([l({type:W})],as.prototype,"base",void 0);f([l({type:h.Integer,context:0,defaultValue:0,implicit:!0})],as.prototype,"minimum",void 0);f([l({type:h.Integer,context:1,optional:!0,implicit:!0})],as.prototype,"maximum",void 0);var us,tl=G0=(us=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,G0.prototype)}},o(us,"GeneralSubtrees"),us);tl=G0=f([b({type:g.Sequence,itemType:as})],tl);var Z0=class Z0{constructor(e={}){Object.assign(this,e)}};o(Z0,"NameConstraints");var rl=Z0;f([l({type:tl,context:0,optional:!0,implicit:!0})],rl.prototype,"permittedSubtrees",void 0);f([l({type:tl,context:1,optional:!0,implicit:!0})],rl.prototype,"excludedSubtrees",void 0);var nD=`${z}.36`,Q0=class Q0{constructor(e={}){Object.assign(this,e)}};o(Q0,"PolicyConstraints");var nl=Q0;f([l({type:h.Integer,context:0,implicit:!0,optional:!0,converter:ne})],nl.prototype,"requireExplicitPolicy",void 0);f([l({type:h.Integer,context:1,implicit:!0,optional:!0,converter:ne})],nl.prototype,"inhibitPolicyMapping",void 0);var Y0,cD=`${z}.33`,em=class em{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}};o(em,"PolicyMapping");var Pc=em;f([l({type:h.ObjectIdentifier})],Pc.prototype,"issuerDomainPolicy",void 0);f([l({type:h.ObjectIdentifier})],Pc.prototype,"subjectDomainPolicy",void 0);var cs,T_=Y0=(cs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Y0.prototype)}},o(cs,"PolicyMappings"),cs);T_=Y0=f([b({type:g.Sequence,itemType:Pc})],T_);var tm,rm=`${z}.17`,fs,il=tm=(fs=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,tm.prototype)}},o(fs,"SubjectAlternativeName"),fs);il=tm=f([b({type:g.Sequence})],il);var nm=class nm{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};o(nm,"Attribute");var Ye=nm;f([l({type:h.ObjectIdentifier})],Ye.prototype,"type",void 0);f([l({type:h.Any,repeated:"set"})],Ye.prototype,"values",void 0);var im,CD=`${z}.9`,ds,I_=im=(ds=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,im.prototype)}},o(ds,"SubjectDirectoryAttributes"),ds);I_=im=f([b({type:g.Sequence,itemType:Ye})],I_);var om=`${z}.14`,sm=class sm extends Ni{};o(sm,"SubjectKeyIdentifier");var Ct=sm;var DD=`${z}.16`,um=class um{constructor(e={}){Object.assign(this,e)}};o(um,"PrivateKeyUsagePeriod");var ol=um;f([l({type:h.GeneralizedTime,context:0,implicit:!0,optional:!0})],ol.prototype,"notBefore",void 0);f([l({type:h.GeneralizedTime,context:1,implicit:!0,optional:!0})],ol.prototype,"notAfter",void 0);var Tc;(function(t){t[t.keyUpdateAllowed=1]="keyUpdateAllowed",t[t.newExtensions=2]="newExtensions",t[t.pKIXCertificate=4]="pKIXCertificate"})(Tc||(Tc={}));var am=class am extends Or{toJSON(){let e=[],r=this.toNumber();return r&Tc.pKIXCertificate&&e.push("pKIXCertificate"),r&Tc.newExtensions&&e.push("newExtensions"),r&Tc.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}};o(am,"EntrustInfo");var sl=am,cm=class cm{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new sl,Object.assign(this,e)}};o(cm,"EntrustVersionInfo");var ul=cm;f([l({type:h.GeneralString})],ul.prototype,"entrustVers",void 0);f([l({type:sl})],ul.prototype,"entrustInfoFlags",void 0);var fm,JD=`${Vn}.11`,ls,O_=fm=(ls=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,fm.prototype)}},o(ls,"SubjectInfoAccessSyntax"),ls);O_=fm=f([b({type:g.Sequence,itemType:sn})],O_);var R_=kr(Qr());var al=class al{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof al&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&R_.isEqual(e.parameters,this.parameters)||e.parameters===this.parameters)}};o(al,"AlgorithmIdentifier");var k=al;f([l({type:h.ObjectIdentifier})],k.prototype,"algorithm",void 0);f([l({type:h.Any,optional:!0})],k.prototype,"parameters",void 0);var dm=class dm{constructor(e={}){this.algorithm=new k,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}};o(dm,"SubjectPublicKeyInfo");var ot=dm;f([l({type:k})],ot.prototype,"algorithm",void 0);f([l({type:h.BitString})],ot.prototype,"subjectPublicKey",void 0);var ps,Oe=(ps=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){let r=new Date(e);r.setMilliseconds(0),r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}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}},o(ps,"Time"),ps);f([l({type:h.UTCTime})],Oe.prototype,"utcTime",void 0);f([l({type:h.GeneralizedTime})],Oe.prototype,"generalTime",void 0);Oe=f([b({type:g.Choice})],Oe);var lm=class lm{constructor(e){this.notBefore=new Oe(new Date),this.notAfter=new Oe(new Date),e&&(this.notBefore=new Oe(e.notBefore),this.notAfter=new Oe(e.notAfter))}};o(lm,"Validity");var Ln=lm;f([l({type:Oe})],Ln.prototype,"notBefore",void 0);f([l({type:Oe})],Ln.prototype,"notAfter",void 0);var pm,cl=class cl{constructor(e={}){this.extnID="",this.critical=cl.CRITICAL,this.extnValue=new V,Object.assign(this,e)}};o(cl,"Extension");var st=cl;st.CRITICAL=!1;f([l({type:h.ObjectIdentifier})],st.prototype,"extnID",void 0);f([l({type:h.Boolean,defaultValue:st.CRITICAL})],st.prototype,"critical",void 0);f([l({type:V})],st.prototype,"extnValue",void 0);var hs,Zt=pm=(hs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,pm.prototype)}},o(hs,"Extensions"),hs);Zt=pm=f([b({type:g.Sequence,itemType:st})],Zt);var cn;(function(t){t[t.v1=0]="v1",t[t.v2=1]="v2",t[t.v3=2]="v3"})(cn||(cn={}));var hm=class hm{constructor(e={}){this.version=cn.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new k,this.issuer=new be,this.validity=new Ln,this.subject=new be,this.subjectPublicKeyInfo=new ot,Object.assign(this,e)}};o(hm,"TBSCertificate");var ut=hm;f([l({type:h.Integer,context:0,defaultValue:cn.v1})],ut.prototype,"version",void 0);f([l({type:h.Integer,converter:ne})],ut.prototype,"serialNumber",void 0);f([l({type:k})],ut.prototype,"signature",void 0);f([l({type:be})],ut.prototype,"issuer",void 0);f([l({type:Ln})],ut.prototype,"validity",void 0);f([l({type:be})],ut.prototype,"subject",void 0);f([l({type:ot})],ut.prototype,"subjectPublicKeyInfo",void 0);f([l({type:h.BitString,context:1,implicit:!0,optional:!0})],ut.prototype,"issuerUniqueID",void 0);f([l({type:h.BitString,context:2,implicit:!0,optional:!0})],ut.prototype,"subjectUniqueID",void 0);f([l({type:Zt,context:3,optional:!0})],ut.prototype,"extensions",void 0);var ym=class ym{constructor(e={}){this.tbsCertificate=new ut,this.signatureAlgorithm=new k,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}};o(ym,"Certificate");var yr=ym;f([l({type:ut,raw:!0})],yr.prototype,"tbsCertificate",void 0);f([l({type:k})],yr.prototype,"signatureAlgorithm",void 0);f([l({type:h.BitString})],yr.prototype,"signatureValue",void 0);var mm=class mm{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Oe,Object.assign(this,e)}};o(mm,"RevokedCertificate");var Mi=mm;f([l({type:h.Integer,converter:ne})],Mi.prototype,"userCertificate",void 0);f([l({type:Oe})],Mi.prototype,"revocationDate",void 0);f([l({type:st,optional:!0,repeated:"sequence"})],Mi.prototype,"crlEntryExtensions",void 0);var gm=class gm{constructor(e={}){this.signature=new k,this.issuer=new be,this.thisUpdate=new Oe,Object.assign(this,e)}};o(gm,"TBSCertList");var Mt=gm;f([l({type:h.Integer,optional:!0})],Mt.prototype,"version",void 0);f([l({type:k})],Mt.prototype,"signature",void 0);f([l({type:be})],Mt.prototype,"issuer",void 0);f([l({type:Oe})],Mt.prototype,"thisUpdate",void 0);f([l({type:Oe,optional:!0})],Mt.prototype,"nextUpdate",void 0);f([l({type:Mi,repeated:"sequence",optional:!0})],Mt.prototype,"revokedCertificates",void 0);f([l({type:st,optional:!0,context:0,repeated:"sequence"})],Mt.prototype,"crlExtensions",void 0);var vm=class vm{constructor(e={}){this.tbsCertList=new Mt,this.signatureAlgorithm=new k,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};o(vm,"CertificateList");var Ui=vm;f([l({type:Mt,raw:!0})],Ui.prototype,"tbsCertList",void 0);f([l({type:k})],Ui.prototype,"signatureAlgorithm",void 0);f([l({type:h.BitString})],Ui.prototype,"signature",void 0);var C=kr(Qr());var bm=class bm{constructor(e={}){this.issuer=new be,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}};o(bm,"IssuerAndSerialNumber");var mr=bm;f([l({type:be})],mr.prototype,"issuer",void 0);f([l({type:h.Integer,converter:ne})],mr.prototype,"serialNumber",void 0);var ys,$i=(ys=class{constructor(e={}){Object.assign(this,e)}},o(ys,"SignerIdentifier"),ys);f([l({type:Ct,context:0,implicit:!0})],$i.prototype,"subjectKeyIdentifier",void 0);f([l({type:mr})],$i.prototype,"issuerAndSerialNumber",void 0);$i=f([b({type:g.Choice})],$i);var et;(function(t){t[t.v0=0]="v0",t[t.v1=1]="v1",t[t.v2=2]="v2",t[t.v3=3]="v3",t[t.v4=4]="v4",t[t.v5=5]="v5"})(et||(et={}));var ms,Vi=(ms=class extends k{},o(ms,"DigestAlgorithmIdentifier"),ms);Vi=f([b({type:g.Sequence})],Vi);var gs,Ic=(gs=class extends k{},o(gs,"SignatureAlgorithmIdentifier"),gs);Ic=f([b({type:g.Sequence})],Ic);var vs,Et=(vs=class extends k{},o(vs,"KeyEncryptionAlgorithmIdentifier"),vs);Et=f([b({type:g.Sequence})],Et);var bs,Oc=(bs=class extends k{},o(bs,"ContentEncryptionAlgorithmIdentifier"),bs);Oc=f([b({type:g.Sequence})],Oc);var ws,N_=(ws=class extends k{},o(ws,"MessageAuthenticationCodeAlgorithm"),ws);N_=f([b({type:g.Sequence})],N_);var _s,fl=(_s=class extends k{},o(_s,"KeyDerivationAlgorithmIdentifier"),_s);fl=f([b({type:g.Sequence})],fl);var wm=class wm{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};o(wm,"Attribute");var gr=wm;f([l({type:h.ObjectIdentifier})],gr.prototype,"attrType",void 0);f([l({type:h.Any,repeated:"set"})],gr.prototype,"attrValues",void 0);var _m,xm=class xm{constructor(e={}){this.version=et.v0,this.sid=new $i,this.digestAlgorithm=new Vi,this.signatureAlgorithm=new Ic,this.signature=new V,Object.assign(this,e)}};o(xm,"SignerInfo");var Pt=xm;f([l({type:h.Integer})],Pt.prototype,"version",void 0);f([l({type:$i})],Pt.prototype,"sid",void 0);f([l({type:Vi})],Pt.prototype,"digestAlgorithm",void 0);f([l({type:gr,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],Pt.prototype,"signedAttrs",void 0);f([l({type:Ic})],Pt.prototype,"signatureAlgorithm",void 0);f([l({type:V})],Pt.prototype,"signature",void 0);f([l({type:gr,repeated:"set",context:1,implicit:!0,optional:!0})],Pt.prototype,"unsignedAttrs",void 0);var xs,Rc=_m=(xs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,_m.prototype)}},o(xs,"SignerInfos"),xs);Rc=_m=f([b({type:g.Set,itemType:Pt})],Rc);var As,B_=(As=class extends Pt{},o(As,"CounterSignature"),As);B_=f([b({type:g.Sequence})],B_);var Ss,D_=(Ss=class extends Oe{},o(Ss,"SigningTime"),Ss);D_=f([b({type:g.Choice})],D_);var Am=class Am{constructor(e={}){this.acIssuer=new W,this.acSerial=0,this.attrs=[],Object.assign(this,e)}};o(Am,"ACClearAttrs");var jc=Am;f([l({type:W})],jc.prototype,"acIssuer",void 0);f([l({type:h.Integer})],jc.prototype,"acSerial",void 0);f([l({type:Ye,repeated:"sequence"})],jc.prototype,"attrs",void 0);var Sm,ks,Nc=Sm=(ks=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Sm.prototype)}},o(ks,"AttrSpec"),ks);Nc=Sm=f([b({type:g.Sequence,itemType:h.ObjectIdentifier})],Nc);var km=class km{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}};o(km,"AAControls");var Cs=km;f([l({type:h.Integer,optional:!0})],Cs.prototype,"pathLenConstraint",void 0);f([l({type:Nc,implicit:!0,context:0,optional:!0})],Cs.prototype,"permittedAttrs",void 0);f([l({type:Nc,implicit:!0,context:1,optional:!0})],Cs.prototype,"excludedAttrs",void 0);f([l({type:h.Boolean,defaultValue:!0})],Cs.prototype,"permitUnSpecified",void 0);var Cm=class Cm{constructor(e={}){this.issuer=new xe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}};o(Cm,"IssuerSerial");var Qt=Cm;f([l({type:xe})],Qt.prototype,"issuer",void 0);f([l({type:h.Integer,converter:ne})],Qt.prototype,"serial",void 0);f([l({type:h.BitString,optional:!0})],Qt.prototype,"issuerUID",void 0);var Em;(function(t){t[t.publicKey=0]="publicKey",t[t.publicKeyCert=1]="publicKeyCert",t[t.otherObjectTypes=2]="otherObjectTypes"})(Em||(Em={}));var Pm=class Pm{constructor(e={}){this.digestedObjectType=Em.publicKey,this.digestAlgorithm=new k,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}};o(Pm,"ObjectDigestInfo");var Yt=Pm;f([l({type:h.Enumerated})],Yt.prototype,"digestedObjectType",void 0);f([l({type:h.ObjectIdentifier,optional:!0})],Yt.prototype,"otherObjectTypeID",void 0);f([l({type:k})],Yt.prototype,"digestAlgorithm",void 0);f([l({type:h.BitString})],Yt.prototype,"objectDigest",void 0);var Tm=class Tm{constructor(e={}){Object.assign(this,e)}};o(Tm,"V2Form");var Hi=Tm;f([l({type:xe,optional:!0})],Hi.prototype,"issuerName",void 0);f([l({type:Qt,context:0,implicit:!0,optional:!0})],Hi.prototype,"baseCertificateID",void 0);f([l({type:Yt,context:1,implicit:!0,optional:!0})],Hi.prototype,"objectDigestInfo",void 0);var Es,Li=(Es=class{constructor(e={}){Object.assign(this,e)}},o(Es,"AttCertIssuer"),Es);f([l({type:W,repeated:"sequence"})],Li.prototype,"v1Form",void 0);f([l({type:Hi,context:0,implicit:!0})],Li.prototype,"v2Form",void 0);Li=f([b({type:g.Choice})],Li);var Im=class Im{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}};o(Im,"AttCertValidityPeriod");var Wi=Im;f([l({type:h.GeneralizedTime})],Wi.prototype,"notBeforeTime",void 0);f([l({type:h.GeneralizedTime})],Wi.prototype,"notAfterTime",void 0);var Om=class Om{constructor(e={}){Object.assign(this,e)}};o(Om,"Holder");var Wn=Om;f([l({type:Qt,implicit:!0,context:0,optional:!0})],Wn.prototype,"baseCertificateID",void 0);f([l({type:xe,implicit:!0,context:1,optional:!0})],Wn.prototype,"entityName",void 0);f([l({type:Yt,implicit:!0,context:2,optional:!0})],Wn.prototype,"objectDigestInfo",void 0);var Rm;(function(t){t[t.v2=1]="v2"})(Rm||(Rm={}));var jm=class jm{constructor(e={}){this.version=Rm.v2,this.holder=new Wn,this.issuer=new Li,this.signature=new k,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Wi,this.attributes=[],Object.assign(this,e)}};o(jm,"AttributeCertificateInfo");var Tt=jm;f([l({type:h.Integer})],Tt.prototype,"version",void 0);f([l({type:Wn})],Tt.prototype,"holder",void 0);f([l({type:Li})],Tt.prototype,"issuer",void 0);f([l({type:k})],Tt.prototype,"signature",void 0);f([l({type:h.Integer,converter:ne})],Tt.prototype,"serialNumber",void 0);f([l({type:Wi})],Tt.prototype,"attrCertValidityPeriod",void 0);f([l({type:Ye,repeated:"sequence"})],Tt.prototype,"attributes",void 0);f([l({type:h.BitString,optional:!0})],Tt.prototype,"issuerUniqueID",void 0);f([l({type:Zt,optional:!0})],Tt.prototype,"extensions",void 0);var Nm=class Nm{constructor(e={}){this.acinfo=new Tt,this.signatureAlgorithm=new k,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}};o(Nm,"AttributeCertificate");var Fi=Nm;f([l({type:Tt})],Fi.prototype,"acinfo",void 0);f([l({type:k})],Fi.prototype,"signatureAlgorithm",void 0);f([l({type:h.BitString})],Fi.prototype,"signatureValue",void 0);var Bc;(function(t){t[t.unmarked=1]="unmarked",t[t.unclassified=2]="unclassified",t[t.restricted=4]="restricted",t[t.confidential=8]="confidential",t[t.secret=16]="secret",t[t.topSecret=32]="topSecret"})(Bc||(Bc={}));var Bm=class Bm extends Or{};o(Bm,"ClassList");var Ps=Bm;var Dm=class Dm{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}};o(Dm,"SecurityCategory");var Ts=Dm;f([l({type:h.ObjectIdentifier,implicit:!0,context:0})],Ts.prototype,"type",void 0);f([l({type:h.Any,implicit:!0,context:1})],Ts.prototype,"value",void 0);var qm=class qm{constructor(e={}){this.policyId="",this.classList=new Ps(Bc.unclassified),Object.assign(this,e)}};o(qm,"Clearance");var Dc=qm;f([l({type:h.ObjectIdentifier})],Dc.prototype,"policyId",void 0);f([l({type:Ps,defaultValue:new Ps(Bc.unclassified)})],Dc.prototype,"classList",void 0);f([l({type:Ts,repeated:"set"})],Dc.prototype,"securityCategories",void 0);var Mm=class Mm{constructor(e={}){Object.assign(this,e)}};o(Mm,"IetfAttrSyntaxValueChoices");var Is=Mm;f([l({type:V})],Is.prototype,"cotets",void 0);f([l({type:h.ObjectIdentifier})],Is.prototype,"oid",void 0);f([l({type:h.Utf8String})],Is.prototype,"string",void 0);var Um=class Um{constructor(e={}){this.values=[],Object.assign(this,e)}};o(Um,"IetfAttrSyntax");var dl=Um;f([l({type:xe,implicit:!0,context:0,optional:!0})],dl.prototype,"policyAuthority",void 0);f([l({type:Is,repeated:"sequence"})],dl.prototype,"values",void 0);var eV=`${Vn}.4`,tV=`${Vn}.6`,rV=`${Vn}.10`,nV=`${z}.55`,qc=`${$n}.10`,iV=`${qc}.1`,oV=`${qc}.2`,sV=`${qc}.3`,uV=`${qc}.4`,aV=`${qc}.6`,$m="2.5.4",cV=`${$m}.72`;var Vm,Hm=class Hm{constructor(e={}){this.targetCertificate=new Qt,Object.assign(this,e)}};o(Hm,"TargetCert");var js=Hm;f([l({type:Qt})],js.prototype,"targetCertificate",void 0);f([l({type:W,optional:!0})],js.prototype,"targetName",void 0);f([l({type:Yt,optional:!0})],js.prototype,"certDigestInfo",void 0);var Os,Ns=(Os=class{constructor(e={}){Object.assign(this,e)}},o(Os,"Target"),Os);f([l({type:W,context:0,implicit:!0})],Ns.prototype,"targetName",void 0);f([l({type:W,context:1,implicit:!0})],Ns.prototype,"targetGroup",void 0);f([l({type:js,context:2,implicit:!0})],Ns.prototype,"targetCert",void 0);Ns=f([b({type:g.Choice})],Ns);var Rs,ll=Vm=(Rs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Vm.prototype)}},o(Rs,"Targets"),Rs);ll=Vm=f([b({type:g.Sequence,itemType:Ns})],ll);var Lm,Bs,q_=Lm=(Bs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Lm.prototype)}},o(Bs,"ProxyInfo"),Bs);q_=Lm=f([b({type:g.Sequence,itemType:ll})],q_);var Wm=class Wm{constructor(e={}){Object.assign(this,e)}};o(Wm,"RoleSyntax");var pl=Wm;f([l({type:xe,implicit:!0,context:0,optional:!0})],pl.prototype,"roleAuthority",void 0);f([l({type:W,implicit:!0,context:1})],pl.prototype,"roleName",void 0);var Fm=class Fm{constructor(e={}){this.service=new W,this.ident=new W,Object.assign(this,e)}};o(Fm,"SvceAuthInfo");var Mc=Fm;f([l({type:W})],Mc.prototype,"service",void 0);f([l({type:W})],Mc.prototype,"ident",void 0);f([l({type:V,optional:!0})],Mc.prototype,"authInfo",void 0);var Km,Jm=class Jm{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}};o(Jm,"OtherCertificateFormat");var Uc=Jm;f([l({type:h.ObjectIdentifier})],Uc.prototype,"otherCertFormat",void 0);f([l({type:h.Any})],Uc.prototype,"otherCert",void 0);var Ds,Ki=(Ds=class{constructor(e={}){Object.assign(this,e)}},o(Ds,"CertificateChoices"),Ds);f([l({type:yr})],Ki.prototype,"certificate",void 0);f([l({type:Fi,context:2,implicit:!0})],Ki.prototype,"v2AttrCert",void 0);f([l({type:Uc,context:3,implicit:!0})],Ki.prototype,"other",void 0);Ki=f([b({type:g.Choice})],Ki);var qs,Ji=Km=(qs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Km.prototype)}},o(qs,"CertificateSet"),qs);Ji=Km=f([b({type:g.Set,itemType:Ki})],Ji);var zm=class zm{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}};o(zm,"ContentInfo");var er=zm;f([l({type:h.ObjectIdentifier})],er.prototype,"contentType",void 0);f([l({type:h.Any,context:0})],er.prototype,"content",void 0);var Ms,Us=(Ms=class{constructor(e={}){Object.assign(this,e)}},o(Ms,"EncapsulatedContent"),Ms);f([l({type:V})],Us.prototype,"single",void 0);f([l({type:h.Any})],Us.prototype,"any",void 0);Us=f([b({type:g.Choice})],Us);var Gm=class Gm{constructor(e={}){this.eContentType="",Object.assign(this,e)}};o(Gm,"EncapsulatedContentInfo");var zi=Gm;f([l({type:h.ObjectIdentifier})],zi.prototype,"eContentType",void 0);f([l({type:Us,context:0,optional:!0})],zi.prototype,"eContent",void 0);var $s,$c=($s=class{constructor(e={}){Object.assign(this,e)}},o($s,"EncryptedContent"),$s);f([l({type:V,context:0,implicit:!0,optional:!0})],$c.prototype,"value",void 0);f([l({type:V,converter:l_,context:0,implicit:!0,optional:!0,repeated:"sequence"})],$c.prototype,"constructedValue",void 0);$c=f([b({type:g.Choice})],$c);var Xm=class Xm{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Oc,Object.assign(this,e)}};o(Xm,"EncryptedContentInfo");var Fn=Xm;f([l({type:h.ObjectIdentifier})],Fn.prototype,"contentType",void 0);f([l({type:Oc})],Fn.prototype,"contentEncryptionAlgorithm",void 0);f([l({type:$c,optional:!0})],Fn.prototype,"encryptedContent",void 0);var Zm=class Zm{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}};o(Zm,"OtherKeyAttribute");var Kn=Zm;f([l({type:h.ObjectIdentifier})],Kn.prototype,"keyAttrId",void 0);f([l({type:h.Any,optional:!0})],Kn.prototype,"keyAttr",void 0);var Qm,Ym=class Ym{constructor(e={}){this.subjectKeyIdentifier=new Ct,Object.assign(this,e)}};o(Ym,"RecipientKeyIdentifier");var Ws=Ym;f([l({type:Ct})],Ws.prototype,"subjectKeyIdentifier",void 0);f([l({type:h.GeneralizedTime,optional:!0})],Ws.prototype,"date",void 0);f([l({type:Kn,optional:!0})],Ws.prototype,"other",void 0);var Vs,Fs=(Vs=class{constructor(e={}){Object.assign(this,e)}},o(Vs,"KeyAgreeRecipientIdentifier"),Vs);f([l({type:Ws,context:0,implicit:!0,optional:!0})],Fs.prototype,"rKeyId",void 0);f([l({type:mr,optional:!0})],Fs.prototype,"issuerAndSerialNumber",void 0);Fs=f([b({type:g.Choice})],Fs);var eg=class eg{constructor(e={}){this.rid=new Fs,this.encryptedKey=new V,Object.assign(this,e)}};o(eg,"RecipientEncryptedKey");var Vc=eg;f([l({type:Fs})],Vc.prototype,"rid",void 0);f([l({type:V})],Vc.prototype,"encryptedKey",void 0);var Hs,hl=Qm=(Hs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Qm.prototype)}},o(Hs,"RecipientEncryptedKeys"),Hs);hl=Qm=f([b({type:g.Sequence,itemType:Vc})],hl);var tg=class tg{constructor(e={}){this.algorithm=new k,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}};o(tg,"OriginatorPublicKey");var Hc=tg;f([l({type:k})],Hc.prototype,"algorithm",void 0);f([l({type:h.BitString})],Hc.prototype,"publicKey",void 0);var Ls,Gi=(Ls=class{constructor(e={}){Object.assign(this,e)}},o(Ls,"OriginatorIdentifierOrKey"),Ls);f([l({type:Ct,context:0,implicit:!0,optional:!0})],Gi.prototype,"subjectKeyIdentifier",void 0);f([l({type:Hc,context:1,implicit:!0,optional:!0})],Gi.prototype,"originatorKey",void 0);f([l({type:mr,optional:!0})],Gi.prototype,"issuerAndSerialNumber",void 0);Gi=f([b({type:g.Choice})],Gi);var rg=class rg{constructor(e={}){this.version=et.v3,this.originator=new Gi,this.keyEncryptionAlgorithm=new Et,this.recipientEncryptedKeys=new hl,Object.assign(this,e)}};o(rg,"KeyAgreeRecipientInfo");var fn=rg;f([l({type:h.Integer})],fn.prototype,"version",void 0);f([l({type:Gi,context:0})],fn.prototype,"originator",void 0);f([l({type:V,context:1,optional:!0})],fn.prototype,"ukm",void 0);f([l({type:Et})],fn.prototype,"keyEncryptionAlgorithm",void 0);f([l({type:hl})],fn.prototype,"recipientEncryptedKeys",void 0);var Ks,Js=(Ks=class{constructor(e={}){Object.assign(this,e)}},o(Ks,"RecipientIdentifier"),Ks);f([l({type:Ct,context:0,implicit:!0})],Js.prototype,"subjectKeyIdentifier",void 0);f([l({type:mr})],Js.prototype,"issuerAndSerialNumber",void 0);Js=f([b({type:g.Choice})],Js);var ng=class ng{constructor(e={}){this.version=et.v0,this.rid=new Js,this.keyEncryptionAlgorithm=new Et,this.encryptedKey=new V,Object.assign(this,e)}};o(ng,"KeyTransRecipientInfo");var Jn=ng;f([l({type:h.Integer})],Jn.prototype,"version",void 0);f([l({type:Js})],Jn.prototype,"rid",void 0);f([l({type:Et})],Jn.prototype,"keyEncryptionAlgorithm",void 0);f([l({type:V})],Jn.prototype,"encryptedKey",void 0);var ig=class ig{constructor(e={}){this.keyIdentifier=new V,Object.assign(this,e)}};o(ig,"KEKIdentifier");var Xi=ig;f([l({type:V})],Xi.prototype,"keyIdentifier",void 0);f([l({type:h.GeneralizedTime,optional:!0})],Xi.prototype,"date",void 0);f([l({type:Kn,optional:!0})],Xi.prototype,"other",void 0);var og=class og{constructor(e={}){this.version=et.v4,this.kekid=new Xi,this.keyEncryptionAlgorithm=new Et,this.encryptedKey=new V,Object.assign(this,e)}};o(og,"KEKRecipientInfo");var zn=og;f([l({type:h.Integer})],zn.prototype,"version",void 0);f([l({type:Xi})],zn.prototype,"kekid",void 0);f([l({type:Et})],zn.prototype,"keyEncryptionAlgorithm",void 0);f([l({type:V})],zn.prototype,"encryptedKey",void 0);var sg=class sg{constructor(e={}){this.version=et.v0,this.keyEncryptionAlgorithm=new Et,this.encryptedKey=new V,Object.assign(this,e)}};o(sg,"PasswordRecipientInfo");var Gn=sg;f([l({type:h.Integer})],Gn.prototype,"version",void 0);f([l({type:fl,context:0,optional:!0})],Gn.prototype,"keyDerivationAlgorithm",void 0);f([l({type:Et})],Gn.prototype,"keyEncryptionAlgorithm",void 0);f([l({type:V})],Gn.prototype,"encryptedKey",void 0);var ug=class ug{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}};o(ug,"OtherRecipientInfo");var Lc=ug;f([l({type:h.ObjectIdentifier})],Lc.prototype,"oriType",void 0);f([l({type:h.Any})],Lc.prototype,"oriValue",void 0);var zs,dn=(zs=class{constructor(e={}){Object.assign(this,e)}},o(zs,"RecipientInfo"),zs);f([l({type:Jn,optional:!0})],dn.prototype,"ktri",void 0);f([l({type:fn,context:1,implicit:!0,optional:!0})],dn.prototype,"kari",void 0);f([l({type:zn,context:2,implicit:!0,optional:!0})],dn.prototype,"kekri",void 0);f([l({type:Gn,context:3,implicit:!0,optional:!0})],dn.prototype,"pwri",void 0);f([l({type:Lc,context:4,implicit:!0,optional:!0})],dn.prototype,"ori",void 0);dn=f([b({type:g.Choice})],dn);var ag,Gs,Wc=ag=(Gs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,ag.prototype)}},o(Gs,"RecipientInfos"),Gs);Wc=ag=f([b({type:g.Set,itemType:dn})],Wc);var cg,M_=`${$n}.16`,fL=`${M_}.2`,dL=`${M_}.4`,fg=class fg{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}};o(fg,"OtherRevocationInfoFormat");var Qs=fg;f([l({type:h.ObjectIdentifier})],Qs.prototype,"otherRevInfoFormat",void 0);f([l({type:h.Any})],Qs.prototype,"otherRevInfo",void 0);var Xs,yl=(Xs=class{constructor(e={}){this.other=new Qs,Object.assign(this,e)}},o(Xs,"RevocationInfoChoice"),Xs);f([l({type:Qs,context:1,implicit:!0})],yl.prototype,"other",void 0);yl=f([b({type:g.Choice})],yl);var Zs,Ys=cg=(Zs=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,cg.prototype)}},o(Zs,"RevocationInfoChoices"),Zs);Ys=cg=f([b({type:g.Set,itemType:yl})],Ys);var dg=class dg{constructor(e={}){Object.assign(this,e)}};o(dg,"OriginatorInfo");var eu=dg;f([l({type:Ji,context:0,implicit:!0,optional:!0})],eu.prototype,"certs",void 0);f([l({type:Ys,context:1,implicit:!0,optional:!0})],eu.prototype,"crls",void 0);var lg,tu,pg=lg=(tu=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,lg.prototype)}},o(tu,"UnprotectedAttributes"),tu);pg=lg=f([b({type:g.Set,itemType:gr})],pg);var hg=class hg{constructor(e={}){this.version=et.v0,this.recipientInfos=new Wc,this.encryptedContentInfo=new Fn,Object.assign(this,e)}};o(hg,"EnvelopedData");var Zi=hg;f([l({type:h.Integer})],Zi.prototype,"version",void 0);f([l({type:eu,context:0,implicit:!0,optional:!0})],Zi.prototype,"originatorInfo",void 0);f([l({type:Wc})],Zi.prototype,"recipientInfos",void 0);f([l({type:Fn})],Zi.prototype,"encryptedContentInfo",void 0);f([l({type:pg,context:1,implicit:!0,optional:!0})],Zi.prototype,"unprotectedAttrs",void 0);var U_="1.2.840.113549.1.7.2";var yg,ru,ml=yg=(ru=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,yg.prototype)}},o(ru,"DigestAlgorithmIdentifiers"),ru);ml=yg=f([b({type:g.Set,itemType:Vi})],ml);var mg=class mg{constructor(e={}){this.version=et.v0,this.digestAlgorithms=new ml,this.encapContentInfo=new zi,this.signerInfos=new Rc,Object.assign(this,e)}};o(mg,"SignedData");var ln=mg;f([l({type:h.Integer})],ln.prototype,"version",void 0);f([l({type:ml})],ln.prototype,"digestAlgorithms",void 0);f([l({type:zi})],ln.prototype,"encapContentInfo",void 0);f([l({type:Ji,context:0,implicit:!0,optional:!0})],ln.prototype,"certificates",void 0);f([l({type:Ys,context:1,implicit:!0,optional:!0})],ln.prototype,"crls",void 0);f([l({type:Rc})],ln.prototype,"signerInfos",void 0);var Qi="1.2.840.10045.2.1";var Fc="1.2.840.10045.4.1",gl="1.2.840.10045.4.3.1",Kc="1.2.840.10045.4.3.2",Jc="1.2.840.10045.4.3.3",zc="1.2.840.10045.4.3.4";var gg="1.2.840.10045.3.1.7";var vg="1.3.132.0.34";var bg="1.3.132.0.35";function Gc(t){return new k({algorithm:t})}o(Gc,"create");var V_=Gc(Fc),uW=Gc(gl),H_=Gc(Kc),L_=Gc(Jc),W_=Gc(zc);var nu,Xc=(nu=class{constructor(e={}){Object.assign(this,e)}},o(nu,"FieldID"),nu);f([l({type:h.ObjectIdentifier})],Xc.prototype,"fieldType",void 0);f([l({type:h.Any})],Xc.prototype,"parameters",void 0);Xc=f([b({type:g.Sequence})],Xc);var xg=class xg extends V{};o(xg,"ECPoint");var wg=xg;var iu,su=(iu=class{constructor(e={}){Object.assign(this,e)}},o(iu,"Curve"),iu);f([l({type:h.OctetString})],su.prototype,"a",void 0);f([l({type:h.OctetString})],su.prototype,"b",void 0);f([l({type:h.BitString,optional:!0})],su.prototype,"seed",void 0);su=f([b({type:g.Sequence})],su);var _g;(function(t){t[t.ecpVer1=1]="ecpVer1"})(_g||(_g={}));var ou,Nr=(ou=class{constructor(e={}){this.version=_g.ecpVer1,Object.assign(this,e)}},o(ou,"SpecifiedECDomain"),ou);f([l({type:h.Integer})],Nr.prototype,"version",void 0);f([l({type:Xc})],Nr.prototype,"fieldID",void 0);f([l({type:su})],Nr.prototype,"curve",void 0);f([l({type:wg})],Nr.prototype,"base",void 0);f([l({type:h.Integer,converter:ne})],Nr.prototype,"order",void 0);f([l({type:h.Integer,optional:!0})],Nr.prototype,"cofactor",void 0);Nr=f([b({type:g.Sequence})],Nr);var uu,Br=(uu=class{constructor(e={}){Object.assign(this,e)}},o(uu,"ECParameters"),uu);f([l({type:h.ObjectIdentifier})],Br.prototype,"namedCurve",void 0);f([l({type:h.Null})],Br.prototype,"implicitCurve",void 0);f([l({type:Nr})],Br.prototype,"specifiedCurve",void 0);Br=f([b({type:g.Choice})],Br);var Ag=class Ag{constructor(e={}){this.version=1,this.privateKey=new V,Object.assign(this,e)}};o(Ag,"ECPrivateKey");var au=Ag;f([l({type:h.Integer})],au.prototype,"version",void 0);f([l({type:V})],au.prototype,"privateKey",void 0);f([l({type:Br,context:0,optional:!0})],au.prototype,"parameters",void 0);f([l({type:h.BitString,context:1,optional:!0})],au.prototype,"publicKey",void 0);var Sg=class Sg{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}};o(Sg,"ECDSASigValue");var Yi=Sg;f([l({type:h.Integer,converter:ne})],Yi.prototype,"r",void 0);f([l({type:h.Integer,converter:ne})],Yi.prototype,"s",void 0);var It="1.2.840.113549.1.1",Dr=`${It}.1`,F_=`${It}.7`,K_=`${It}.9`,Xn=`${It}.10`,J_=`${It}.2`,z_=`${It}.4`,cu=`${It}.5`,G_=`${It}.14`;var vl=`${It}.11`,fu=`${It}.12`,du=`${It}.13`,kg=`${It}.15`,Cg=`${It}.16`,eo="1.3.14.3.2.26",bl="2.16.840.1.101.3.4.2.4",to="2.16.840.1.101.3.4.2.1",ro="2.16.840.1.101.3.4.2.2",no="2.16.840.1.101.3.4.2.3",X_="2.16.840.1.101.3.4.2.5",Z_="2.16.840.1.101.3.4.2.6",Q_="1.2.840.113549.2.2",Y_="1.2.840.113549.2.5",Zn=`${It}.8`;function Ke(t){return new k({algorithm:t,parameters:null})}o(Ke,"create");var DW=Ke(Q_),qW=Ke(Y_),pn=Ke(eo),MW=Ke(bl),UW=Ke(to),$W=Ke(ro),VW=Ke(no),HW=Ke(X_),LW=Ke(Z_),wl=new k({algorithm:Zn,parameters:P.serialize(pn)}),Eg=new k({algorithm:K_,parameters:P.serialize(Do.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))}),WW=Ke(Dr),FW=Ke(J_),KW=Ke(z_),JW=Ke(cu),zW=Ke(kg),GW=Ke(Cg),XW=Ke(fu),ZW=Ke(du),QW=Ke(kg),YW=Ke(Cg);var Pg=class Pg{constructor(e={}){this.hashAlgorithm=new k(pn),this.maskGenAlgorithm=new k({algorithm:Zn,parameters:P.serialize(pn)}),this.pSourceAlgorithm=new k(Eg),Object.assign(this,e)}};o(Pg,"RsaEsOaepParams");var lu=Pg;f([l({type:k,context:0,defaultValue:pn})],lu.prototype,"hashAlgorithm",void 0);f([l({type:k,context:1,defaultValue:wl})],lu.prototype,"maskGenAlgorithm",void 0);f([l({type:k,context:2,defaultValue:Eg})],lu.prototype,"pSourceAlgorithm",void 0);var uF=new k({algorithm:F_,parameters:P.serialize(new lu)});var Tg=class Tg{constructor(e={}){this.hashAlgorithm=new k(pn),this.maskGenAlgorithm=new k({algorithm:Zn,parameters:P.serialize(pn)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}};o(Tg,"RsaSaPssParams");var qr=Tg;f([l({type:k,context:0,defaultValue:pn})],qr.prototype,"hashAlgorithm",void 0);f([l({type:k,context:1,defaultValue:wl})],qr.prototype,"maskGenAlgorithm",void 0);f([l({type:h.Integer,context:2,defaultValue:20})],qr.prototype,"saltLength",void 0);f([l({type:h.Integer,context:3,defaultValue:1})],qr.prototype,"trailerField",void 0);var yF=new k({algorithm:Xn,parameters:P.serialize(new qr)});var Ig=class Ig{constructor(e={}){this.digestAlgorithm=new k,this.digest=new V,Object.assign(this,e)}};o(Ig,"DigestInfo");var io=Ig;f([l({type:k})],io.prototype,"digestAlgorithm",void 0);f([l({type:V})],io.prototype,"digest",void 0);var Og,Rg=class Rg{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}};o(Rg,"OtherPrimeInfo");var hu=Rg;f([l({type:h.Integer,converter:ne})],hu.prototype,"prime",void 0);f([l({type:h.Integer,converter:ne})],hu.prototype,"exponent",void 0);f([l({type:h.Integer,converter:ne})],hu.prototype,"coefficient",void 0);var pu,_l=Og=(pu=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Og.prototype)}},o(pu,"OtherPrimeInfos"),pu);_l=Og=f([b({type:g.Sequence,itemType:hu})],_l);var jg=class jg{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}};o(jg,"RSAPrivateKey");var tr=jg;f([l({type:h.Integer})],tr.prototype,"version",void 0);f([l({type:h.Integer,converter:ne})],tr.prototype,"modulus",void 0);f([l({type:h.Integer,converter:ne})],tr.prototype,"publicExponent",void 0);f([l({type:h.Integer,converter:ne})],tr.prototype,"privateExponent",void 0);f([l({type:h.Integer,converter:ne})],tr.prototype,"prime1",void 0);f([l({type:h.Integer,converter:ne})],tr.prototype,"prime2",void 0);f([l({type:h.Integer,converter:ne})],tr.prototype,"exponent1",void 0);f([l({type:h.Integer,converter:ne})],tr.prototype,"exponent2",void 0);f([l({type:h.Integer,converter:ne})],tr.prototype,"coefficient",void 0);f([l({type:_l,optional:!0})],tr.prototype,"otherPrimeInfos",void 0);var Ng=class Ng{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}};o(Ng,"RSAPublicKey");var yu=Ng;f([l({type:h.Integer,converter:ne})],yu.prototype,"modulus",void 0);f([l({type:h.Integer,converter:ne})],yu.prototype,"publicExponent",void 0);var Bg;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(Bg||(Bg={}));var tt=Bg;var Dg=o(function(t,e){return Dg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Dg(t,e)},"extendStatics");function Zc(t,e){Dg(t,e);function r(){this.constructor=t}o(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}o(Zc,"__extends");function e2(t,e,r,n){function i(s){return s instanceof r?s:new r(function(u){u(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,u){function a(p){try{d(n.next(p))}catch(y){u(y)}}o(a,"fulfilled");function c(p){try{d(n.throw(p))}catch(y){u(y)}}o(c,"rejected");function d(p){p.done?s(p.value):i(p.value).then(a,c)}o(d,"step"),d((n=n.apply(t,e||[])).next())})}o(e2,"__awaiter");function t2(t,e){var r={label:0,sent:o(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,i,s,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(d){return function(p){return c([d,p])}}function c(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=d[0]&2?i.return:d[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,d[1])).done)return s;switch(i=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(p){d=[6,p],i=0}finally{n=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}o(t2,"__generator");function Qc(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:o(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}o(Qc,"__values");function mu(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],u;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){u={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}o(mu,"__read");function Mr(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(mu(arguments[e]));return t}o(Mr,"__spread");var tk="injectionTokens";function qg(t){var e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(tk,t)||{};return Object.keys(r).forEach(function(n){e[+n]=r[n]}),e}o(qg,"getParamInfo");function Yc(t){return!!t.useClass}o(Yc,"isClassProvider");function gu(t){return!!t.useFactory}o(gu,"isFactoryProvider");var xl=(function(){function t(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return o(t,"DelayedConstructor"),t.prototype.createProxy=function(e){var r=this,n={},i=!1,s,u=o(function(){return i||(s=e(r.wrap()),i=!0),s},"delayedObject");return new Proxy(n,this.createHandler(u))},t.prototype.createHandler=function(e){var r={},n=o(function(i){r[i]=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];s[0]=e();var a=Reflect[i];return a.apply(void 0,Mr(s))}},"install");return this.reflectMethods.forEach(n),r},t})();function Qn(t){return typeof t=="string"||typeof t=="symbol"}o(Qn,"isNormalToken");function Mg(t){return typeof t=="object"&&"token"in t&&"multiple"in t}o(Mg,"isTokenDescriptor");function Al(t){return typeof t=="object"&&"token"in t&&"transform"in t}o(Al,"isTransformDescriptor");function r2(t){return typeof t=="function"||t instanceof xl}o(r2,"isConstructorToken");function oo(t){return!!t.useToken}o(oo,"isTokenProvider");function so(t){return t.useValue!=null}o(so,"isValueProvider");function n2(t){return Yc(t)||so(t)||oo(t)||gu(t)}o(n2,"isProvider");var rk=(function(){function t(){this._registryMap=new Map}return o(t,"RegistryBase"),t.prototype.entries=function(){return this._registryMap.entries()},t.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},t.prototype.get=function(e){this.ensure(e);var r=this._registryMap.get(e);return r[r.length-1]||null},t.prototype.set=function(e,r){this.ensure(e),this._registryMap.get(e).push(r)},t.prototype.setAll=function(e,r){this._registryMap.set(e,r)},t.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},t.prototype.clear=function(){this._registryMap.clear()},t.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},t})(),ef=rk;var nk=(function(t){Zc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return o(e,"Registry"),e})(ef),i2=nk;var ik=(function(){function t(){this.scopedResolutions=new Map}return o(t,"ResolutionContext"),t})(),tf=ik;function ok(t,e){if(t===null)return"at position #"+e;var r=t.split(",")[e].trim();return'"'+r+'" at position #'+e}o(ok,"formatDependency");function sk(t,e,r){return r===void 0&&(r=" "),Mr([t],e.message.split(`
|
|
14
|
+
`)}`:`${r} :`}};o(Iy,"Constructed");var me=Iy;p_=me;R.Constructed=p_;me.NAME="CONSTRUCTED";var Oy=class Oy extends ot{fromBER(e,r,n){return r}toBER(e){return Cr}};o(Oy,"LocalEndOfContentValueBlock");var Gd=Oy;Gd.override="EndOfContentValueBlock";var h_,Ry=class Ry extends De{constructor(e={}){super(e,Gd),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};o(Ry,"EndOfContent");var vc=Ry;h_=vc;R.EndOfContent=h_;vc.NAME=mc;var y_,jy=class jy extends De{constructor(e={}){super(e,ot),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,r,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,r+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+n}toBER(e,r){let n=new ArrayBuffer(2);if(!e){let i=new Uint8Array(n);i[0]=5,i[1]=0}return r&&r.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}};o(jy,"Null");var st=jy;y_=st;R.Null=y_;st.NAME="NULL";var Ny=class Ny extends Wr(ot){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,...r}={}){super(r),r.valueHex?this.valueHexView=ne.BufferSourceConverter.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,r,n){let i=ne.BufferSourceConverter.toUint8Array(e);return Tn(this,i,r,n)?(this.valueHexView=i.subarray(r,r+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,yy.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};o(Ny,"LocalBooleanValueBlock");var Xd=Ny;Xd.NAME="BooleanValueBlock";var m_,By=class By extends De{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,Xd),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};o(By,"Boolean");var hn=By;m_=hn;R.Boolean=m_;hn.NAME="BOOLEAN";var Dy=class Dy extends Wr(Vr){constructor({isConstructed:e=!1,...r}={}){super(r),this.isConstructed=e}fromBER(e,r,n){let i=0;if(this.isConstructed){if(this.isHexOnly=!1,i=Vr.prototype.fromBER.call(this,e,r,n),i===-1)return i;for(let s=0;s<this.value.length;s++){let u=this.value[s].constructor.NAME;if(u===mc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(u!==c_)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,i=super.fromBER(e,r,n),this.blockLength=n;return i}toBER(e,r){return this.isConstructed?Vr.prototype.toBER.call(this,e,r):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};o(Dy,"LocalOctetStringValueBlock");var Zd=Dy;Zd.NAME="OctetStringValueBlock";var by,qy=class qy extends De{constructor({idBlock:e={},lenBlock:r={},...n}={}){var i,s;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Zd),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,r,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),r;if(!this.valueBlock.isConstructed){let s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(r,r+n);try{if(s.byteLength){let u=Go(s,0,s.byteLength);u.offset!==-1&&u.offset===n&&(this.valueBlock.value=[u.result])}}catch{}}return super.fromBER(e,r,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return me.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,r=ne.Convert.ToHex(this.valueBlock.valueHexView);return`${e} : ${r}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let r of this.valueBlock.value)r instanceof by&&e.push(r.valueBlock.valueHexView);return ne.BufferSourceConverter.concat(e)}};o(qy,"OctetString");var ut=qy;by=ut;R.OctetString=by;ut.NAME=c_;var My=class My extends Wr(Vr){constructor({unusedBits:e=0,isConstructed:r=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(e,r,n){if(!n)return r;let i=-1;if(this.isConstructed){if(i=Vr.prototype.fromBER.call(this,e,r,n),i===-1)return i;for(let a of this.value){let c=a.constructor.NAME;if(c===mc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==f_)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let d=a.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return i}let s=ne.BufferSourceConverter.toUint8Array(e);if(!Tn(this,s,r,n))return-1;let u=s.subarray(r,r+n);if(this.unusedBits=u[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let a=u.subarray(1);try{if(a.byteLength){let c=Go(a,0,a.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=u.subarray(1),this.blockLength=u.length,r+n}toBER(e,r){if(this.isConstructed)return Vr.prototype.toBER.call(this,e,r);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Cr;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}}};o(My,"LocalBitStringValueBlock");var Qd=My;Qd.NAME="BitStringValueBlock";var g_,Uy=class Uy extends De{constructor({idBlock:e={},lenBlock:r={},...n}={}){var i,s;(i=n.isConstructed)!==null&&i!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Qd),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,r,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,r,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return me.prototype.onAsciiEncoding.call(this);{let e=[],r=this.valueBlock.valueHexView;for(let u of r)e.push(u.toString(2).padStart(8,"0"));let n=e.join(""),i=this.constructor.NAME,s=n.substring(0,n.length-this.valueBlock.unusedBits);return`${i} : ${s}`}}};o(Uy,"BitString");var Nt=Uy;g_=Nt;R.BitString=g_;Nt.NAME=f_;var v_;function fk(t,e){let r=new Uint8Array([0]),n=new Uint8Array(t),i=new Uint8Array(e),s=n.slice(0),u=s.length-1,a=i.slice(0),c=a.length-1,d=0,h=c<u?u:c,y=0;for(let b=h;b>=0;b--,y++)!0===y<a.length?d=s[u-y]+a[c-y]+r[0]:d=s[u-y]+r[0],r[0]=d/10,!0===y>=s.length?s=Wd(new Uint8Array([d%10]),s):s[u-y]=d%10;return r[0]>0&&(s=Wd(r,s)),s}o(fk,"viewAdd");function a_(t){if(t>=hc.length)for(let e=hc.length;e<=t;e++){let r=new Uint8Array([0]),n=hc[e-1].slice(0);for(let i=n.length-1;i>=0;i--){let s=new Uint8Array([(n[i]<<1)+r[0]]);r[0]=s[0]/10,n[i]=s[0]%10}r[0]>0&&(n=Wd(r,n)),hc.push(n)}return hc[t]}o(a_,"power2");function dk(t,e){let r=0,n=new Uint8Array(t),i=new Uint8Array(e),s=n.slice(0),u=s.length-1,a=i.slice(0),c=a.length-1,d,h=0;for(let y=c;y>=0;y--,h++)d=s[u-h]-a[c-h]-r,!0===d<0?(r=1,s[u-h]=d+10):(r=0,s[u-h]=d);if(r>0)for(let y=u-c+1;y>=0;y--,h++)if(d=s[u-h]-r,d<0)r=1,s[u-h]=d+10;else{r=0,s[u-h]=d;break}return s.slice()}o(dk,"viewSub");var $y=class $y extends Wr(ot){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=yy.call(this)))}constructor({value:e,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(i_(e))}get valueDec(){return this._valueDec}fromDER(e,r,n,i=0){let s=this.fromBER(e,r,n);if(s===-1)return s;let u=this.valueHexView;return u[0]===0&&(u[1]&128)!==0?this.valueHexView=u.subarray(1):i!==0&&u.length<i&&(i-u.length>1&&(i=u.length+1),this.valueHexView=u.subarray(i-u.length)),s}toDER(e=!1){let r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(r,1),this.valueHexView=n}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,r,n){let i=super.fromBER(e,r,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,r=new Uint8Array(this.valueHexView.length*8/3),n=0,i,s=this.valueHexView,u="",a=!1;for(let c=s.byteLength-1;c>=0;c--){i=s[c];for(let d=0;d<8;d++)(i&1)===1&&(n===e?(r=dk(a_(n),r),u="-"):r=fk(r,a_(n))),n++,i>>=1}for(let c=0;c<r.length;c++)r[c]&&(a=!0),a&&(u+=s_.charAt(r[c]));return a===!1&&(u+=s_.charAt(0)),u}};o($y,"LocalIntegerValueBlock");var bc=$y;v_=bc;bc.NAME="IntegerValueBlock";Object.defineProperty(v_.prototype,"valueHex",{set:o(function(t){this.valueHexView=new Uint8Array(t),this.setValueHex()},"set"),get:o(function(){return this.valueHexView.slice().buffer},"get")});var yc,Vy=class Vy extends De{constructor(e={}){super(e,bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Fd(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Fd();let r=BigInt(e),n=new Jo,i=r.toString(16).replace(/^-/,""),s=new Uint8Array(ne.Convert.FromHex(i));if(r<0){let a=new Uint8Array(s.length+(s[0]&128?1:0));a[0]|=128;let d=BigInt(`0x${ne.Convert.ToHex(a)}`)+r,h=ne.BufferSourceConverter.toUint8Array(ne.Convert.FromHex(d.toString(16)));h[0]|=128,n.write(h)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new yc({valueHex:n.final()})}convertToDER(){let e=new yc({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new yc({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};o(Vy,"Integer");var kr=Vy;yc=kr;R.Integer=yc;kr.NAME="INTEGER";var b_,Ly=class Ly extends kr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};o(Ly,"Enumerated");var yn=Ly;b_=yn;R.Enumerated=b_;yn.NAME="ENUMERATED";var Hy=class Hy extends Wr(ot){constructor({valueDec:e=-1,isFirstSid:r=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=r}fromBER(e,r,n){if(!n)return r;let i=ne.BufferSourceConverter.toUint8Array(e);if(!Tn(this,i,r,n))return-1;let s=i.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let u=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)u[a]=this.valueHexView[a];return this.valueHexView=u,(s[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=Li(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(e){Fd();let r=BigInt(e).toString(2);for(;r.length%7;)r="0"+r;let n=new Uint8Array(r.length/7);for(let i=0;i<n.length;i++)n[i]=parseInt(r.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,s=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength-1;u++)s[u]=i[u]|128;return s[this.blockLength-1]=i[this.blockLength-1],s.buffer}let r=ii(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",Cr;let n=new Uint8Array(r.byteLength);if(!e){let i=new Uint8Array(r),s=r.byteLength-1;for(let u=0;u<s;u++)n[u]=i[u]|128;n[s]=i[s]}return n}toString(){let e="";if(this.isHexOnly)e=ne.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",r-=40):(e="2.",r-=80),e+=r.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};o(Hy,"LocalSidValueBlock");var wc=Hy;wc.NAME="sidBlock";var Wy=class Wy extends ot{constructor({value:e=jt,...r}={}){super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,n){let i=r;for(;n>0;){let s=new wc;if(i=s.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=s.error,i;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return i}toBER(e){let r=[];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,Cr;r.push(i)}return vy(r)}fromString(e){this.value=[];let r=0,n=0,i="",s=!1;do if(n=e.indexOf(".",r),n===-1?i=e.substring(r):i=e.substring(r,n),r=n+1,s){let u=this.value[0],a=0;switch(u.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}let c=parseInt(i,10);if(isNaN(c))return;u.valueDec=c+a,s=!1}else{let u=new wc;if(i>Number.MAX_SAFE_INTEGER){Fd();let a=BigInt(i);u.valueBigInt=a}else if(u.valueDec=parseInt(i,10),isNaN(u.valueDec))return;this.value.length||(u.isFirstSid=!0,s=!0),this.value.push(u)}while(n!==-1)}toString(){let e="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),r?(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 r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};o(Wy,"LocalObjectIdentifierValueBlock");var Yd=Wy;Yd.NAME="ObjectIdentifierValueBlock";var w_,Fy=class Fy extends De{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Yd),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};o(Fy,"ObjectIdentifier");var mn=Fy;w_=mn;R.ObjectIdentifier=w_;mn.NAME="OBJECT IDENTIFIER";var zy=class zy extends Wr(pn){constructor({valueDec:e=0,...r}={}){super(r),this.valueDec=e}fromBER(e,r,n){if(n===0)return r;let i=ne.BufferSourceConverter.toUint8Array(e);if(!Tn(this,i,r,n))return-1;let s=i.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let a=0;a<n&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let u=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)u[a]=this.valueHexView[a];return this.valueHexView=u,(s[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=Li(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let i=this.valueHexView,s=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength-1;u++)s[u]=i[u]|128;return s[this.blockLength-1]=i[this.blockLength-1],s.buffer}let r=ii(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",Cr;let n=new Uint8Array(r.byteLength);if(!e){let i=new Uint8Array(r),s=r.byteLength-1;for(let u=0;u<s;u++)n[u]=i[u]|128;n[s]=i[s]}return n.buffer}toString(){let e="";return this.isHexOnly?e=ne.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};o(zy,"LocalRelativeSidValueBlock");var _c=zy;_c.NAME="relativeSidBlock";var Ky=class Ky extends ot{constructor({value:e=jt,...r}={}){super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,n){let i=r;for(;n>0;){let s=new _c;if(i=s.fromBER(e,i,n),i===-1)return this.blockLength=0,this.error=s.error,i;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return i}toBER(e,r){let n=[];for(let i=0;i<this.value.length;i++){let s=this.value[i].toBER(e);if(s.byteLength===0)return this.error=this.value[i].error,Cr;n.push(s)}return vy(n)}fromString(e){this.value=[];let r=0,n=0,i="";do{n=e.indexOf(".",r),n===-1?i=e.substring(r):i=e.substring(r,n),r=n+1;let s=new _c;if(s.valueDec=parseInt(i,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let e="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let i=this.value[n].toString();n!==0&&(e=`${e}.`),r&&(i=`{${i}}`),e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};o(Ky,"LocalRelativeObjectIdentifierValueBlock");var el=Ky;el.NAME="RelativeObjectIdentifierValueBlock";var __,Jy=class Jy extends De{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,el),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};o(Jy,"RelativeObjectIdentifier");var xc=Jy;__=xc;R.RelativeObjectIdentifier=__;xc.NAME="RelativeObjectIdentifier";var x_,Gy=class Gy extends me{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};o(Gy,"Sequence");var _e=Gy;x_=_e;R.Sequence=x_;_e.NAME="SEQUENCE";var A_,Xy=class Xy extends me{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};o(Xy,"Set");var ke=Xy;A_=ke;R.Set=A_;ke.NAME="SET";var Zy=class Zy extends Wr(ot){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=jt}toJSON(){return{...super.toJSON(),value:this.value}}};o(Zy,"LocalStringValueBlock");var tl=Zy;tl.NAME="StringValueBlock";var Qy=class Qy extends tl{};o(Qy,"LocalSimpleStringValueBlock");var rl=Qy;rl.NAME="SimpleStringValueBlock";var Yy=class Yy extends gc{constructor({...e}={}){super(e,rl)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,ne.BufferSourceConverter.toUint8Array(e))}fromString(e){let r=e.length,n=this.valueBlock.valueHexView=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);this.valueBlock.value=e}};o(Yy,"LocalSimpleStringBlock");var _t=Yy;_t.NAME="SIMPLE STRING";var em=class em extends _t{fromBuffer(e){this.valueBlock.valueHexView=ne.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=ne.Convert.ToUtf8String(e)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=ne.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(ne.Convert.FromUtf8String(e)),this.valueBlock.value=e}};o(em,"LocalUtf8StringValueBlock");var nl=em;nl.NAME="Utf8StringValueBlock";var S_,tm=class tm extends nl{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};o(tm,"Utf8String");var Bt=tm;S_=Bt;R.Utf8String=S_;Bt.NAME="UTF8String";var rm=class rm extends _t{fromBuffer(e){this.valueBlock.value=ne.Convert.ToUtf16String(e),this.valueBlock.valueHexView=ne.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(ne.Convert.FromUtf16String(e))}};o(rm,"LocalBmpStringValueBlock");var il=rm;il.NAME="BmpStringValueBlock";var k_,nm=class nm extends il{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};o(nm,"BmpString");var gn=nm;k_=gn;R.BmpString=k_;gn.NAME="BMPString";var im=class im extends _t{fromBuffer(e){let r=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(r);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(r))}fromString(e){let r=e.length,n=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let i=0;i<r;i++){let s=ii(e.charCodeAt(i),8),u=new Uint8Array(s);if(u.length>4)continue;let a=4-u.length;for(let c=u.length-1;c>=0;c--)n[i*4+c+a]=u[c]}this.valueBlock.value=e}};o(im,"LocalUniversalStringValueBlock");var ol=im;ol.NAME="UniversalStringValueBlock";var C_,om=class om extends ol{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};o(om,"UniversalString");var vn=om;C_=vn;R.UniversalString=C_;vn.NAME="UniversalString";var E_,sm=class sm extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};o(sm,"NumericString");var bn=sm;E_=bn;R.NumericString=E_;bn.NAME="NumericString";var P_,um=class um extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};o(um,"PrintableString");var wn=um;P_=wn;R.PrintableString=P_;wn.NAME="PrintableString";var T_,am=class am extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};o(am,"TeletexString");var _n=am;T_=_n;R.TeletexString=T_;_n.NAME="TeletexString";var I_,cm=class cm extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};o(cm,"VideotexString");var xn=cm;I_=xn;R.VideotexString=I_;xn.NAME="VideotexString";var O_,fm=class fm extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};o(fm,"IA5String");var An=fm;O_=An;R.IA5String=O_;An.NAME="IA5String";var R_,dm=class dm extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};o(dm,"GraphicString");var Sn=dm;R_=Sn;R.GraphicString=R_;Sn.NAME="GraphicString";var j_,lm=class lm extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};o(lm,"VisibleString");var Lr=lm;j_=Lr;R.VisibleString=j_;Lr.NAME="VisibleString";var N_,pm=class pm extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};o(pm,"GeneralString");var kn=pm;N_=kn;R.GeneralString=N_;kn.NAME="GeneralString";var B_,hm=class hm extends _t{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};o(hm,"CharacterString");var Cn=hm;B_=Cn;R.CharacterString=B_;Cn.NAME="CharacterString";var D_,ym=class ym extends Lr{constructor({value:e,valueDate:r,...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)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,ne.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),r=new ArrayBuffer(e.length),n=new Uint8Array(r);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return r}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 r=new Array(7);return r[0]=Rt(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Rt(this.month,2),r[2]=Rt(this.day,2),r[3]=Rt(this.hour,2),r[4]=Rt(this.minute,2),r[5]=Rt(this.second,2),r[6]="Z",r.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}}};o(ym,"UTCTime");var Hr=ym;D_=Hr;R.UTCTime=D_;Hr.NAME="UTCTime";var q_,mm=class mm extends Hr{constructor(e={}){var r;super(e),(r=this.millisecond)!==null&&r!==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 r=!1,n="",i="",s=0,u,a=0,c=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),r=!0;else{let y=new Number(e[e.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(r){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 y=1,b=n.indexOf("+"),A="";if(b===-1&&(b=n.indexOf("-"),y=-1),b!==-1){if(A=n.substring(b+1),n=n.substring(0,b),A.length!==2&&A.length!==4)throw new Error("Wrong input string for conversion");let S=parseInt(A.substring(0,2),10);if(isNaN(S.valueOf()))throw new Error("Wrong input string for conversion");if(a=y*S,A.length===4){if(S=parseInt(A.substring(2,4),10),isNaN(S.valueOf()))throw new Error("Wrong input string for conversion");c=y*S}}}let d=n.indexOf(".");if(d===-1&&(d=n.indexOf(",")),d!==-1){let y=new Number(`0${n.substring(d)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),i=n.substring(0,d)}else i=n;switch(!0){case i.length===8:if(u=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:if(u=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case i.length===12:if(u=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case i.length===14:if(u=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}let h=u.exec(i);if(h===null)throw new Error("Wrong input string for conversion");for(let y=1;y<h.length;y++)switch(y){case 1:this.year=parseInt(h[y],10);break;case 2:this.month=parseInt(h[y],10);break;case 3:this.day=parseInt(h[y],10);break;case 4:this.hour=parseInt(h[y],10)+a;break;case 5:this.minute=parseInt(h[y],10)+c;break;case 6:this.second=parseInt(h[y],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){let y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let r=[];return r.push(Rt(this.year,4)),r.push(Rt(this.month,2)),r.push(Rt(this.day,2)),r.push(Rt(this.hour,2)),r.push(Rt(this.minute,2)),r.push(Rt(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Rt(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};o(mm,"GeneralizedTime");var En=mm;q_=En;R.GeneralizedTime=q_;En.NAME="GeneralizedTime";var M_,gm=class gm extends Bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};o(gm,"DATE");var Ac=gm;M_=Ac;R.DATE=M_;Ac.NAME="DATE";var U_,vm=class vm extends Bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};o(vm,"TimeOfDay");var Sc=vm;U_=Sc;R.TimeOfDay=U_;Sc.NAME="TimeOfDay";var $_,bm=class bm extends Bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};o(bm,"DateTime");var kc=bm;$_=kc;R.DateTime=$_;kc.NAME="DateTime";var V_,wm=class wm extends Bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};o(wm,"Duration");var Cc=wm;V_=Cc;R.Duration=V_;Cc.NAME="Duration";var L_,_m=class _m extends Bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};o(_m,"TIME");var Ec=_m;L_=Ec;R.TIME=L_;Ec.NAME="TIME";var xm=class xm{constructor({name:e=jt,optional:r=!1}={}){this.name=e,this.optional=r}};o(xm,"Any");var Jt=xm,Am=class Am extends Jt{constructor({value:e=[],...r}={}){super(r),this.value=e}};o(Am,"Choice");var oi=Am,Sm=class Sm extends Jt{constructor({value:e=new Jt,local:r=!1,...n}={}){super(n),this.value=e,this.local=r}};o(Sm,"Repeated");var Pn=Sm,km=class km{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=ne.BufferSourceConverter.toUint8Array(e)}constructor({data:e=sl}={}){this.dataView=ne.BufferSourceConverter.toUint8Array(e)}fromBER(e,r,n){let i=r+n;return this.dataView=ne.BufferSourceConverter.toUint8Array(e).subarray(r,i),i}toBER(e){return this.dataView.slice().buffer}};o(km,"RawData");var gy=km;function or(t,e,r){if(r instanceof oi){for(let s of r.value)if(or(t,e,s).verified)return{verified:!0,result:t};{let s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(my)&&(s.name=r.name),s}}if(r instanceof Jt)return r.hasOwnProperty(my)&&(t[r.name]=e),{verified:!0,result:t};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(tk in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ok in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(sk in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let n=r.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(rk)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:t};if(r.idBlock.hasOwnProperty(nk)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:t};if(r.idBlock.hasOwnProperty(ik)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:t};if(!(ek in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:t};if(r.idBlock.isHexOnly){if(!(u_ in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let s=r.idBlock.valueHexView,u=e.idBlock.valueHexView;if(s.length!==u.length)return{verified:!1,result:t};for(let a=0;a<s.length;a++)if(s[a]!==u[1])return{verified:!1,result:t}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,jt),r.name&&(t[r.name]=e)),r instanceof R.Constructed){let s=0,u={verified:!1,result:{error:"Unknown error"}},a=r.valueBlock.value.length;if(a>0&&r.valueBlock.value[0]instanceof Pn&&(a=e.valueBlock.value.length),a===0)return{verified:!0,result:t};if(e.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{verified:!0,result:t}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,jt),r.name&&delete t[r.name]),t.error="Inconsistent object length",{verified:!1,result:t})}for(let c=0;c<a;c++)if(c-s>=e.valueBlock.value.length){if(r.valueBlock.value[c].optional===!1){let d={verified:!1,result:t};return t.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,jt),r.name&&(delete t[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Pn){if(u=or(t,e.valueBlock.value[c],r.valueBlock.value[0].value),u.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,jt),r.name&&delete t[r.name]),u;if(my in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};uk in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=e:d=t,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(e.valueBlock.value[c])}}else if(u=or(t,e.valueBlock.value[c-s],r.valueBlock.value[c]),u.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,jt),r.name&&delete t[r.name]),u;if(u.verified===!1){let c={verified:!1,result:t};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,jt),r.name&&(delete t[r.name],c.name=r.name)),c}return{verified:!0,result:t}}if(r.primitiveSchema&&u_ in e.valueBlock){let s=Go(e.valueBlock.valueHexView);if(s.offset===-1){let u={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,jt),r.name&&(delete t[r.name],u.name=r.name)),u}return or(t,s.result,r.primitiveSchema)}return{verified:!0,result:t}}o(or,"compareSchema");function lk(t,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let r=Go(ne.BufferSourceConverter.toUint8Array(t));return r.offset===-1?{verified:!1,result:r.result}:or(r.result,r.result,e)}o(lk,"verifySchema");var qe;(function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice"})(qe||(qe={}));var le;(function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null"})(le||(le={}));var pk=Ui(Ko());var Cm=Ui(Ko());var Em=class Em{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):Cm.BufferSourceConverter.isBufferSource(e)?this.buffer=Cm.BufferSourceConverter.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof ut))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new ut({valueHex:this.buffer})}toSchema(e){return new ut({name:e})}};o(Em,"OctetString");var Hi=Em;var hk={fromASN:o(t=>t instanceof st?null:t.valueBeforeDecodeView,"fromASN"),toASN:o(t=>{if(t===null)return new st;let e=at(t);if(e.result.error)throw new Error(e.result.error);return e.result},"toASN")},yk={fromASN:o(t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,"fromASN"),toASN:o(t=>new kr({value:+t}),"toASN")},mk={fromASN:o(t=>t.valueBlock.valueDec,"fromASN"),toASN:o(t=>new yn({value:t}),"toASN")};var gk={fromASN:o(t=>t.valueBlock.valueHexView,"fromASN"),toASN:o(t=>new Nt({valueHex:t}),"toASN")},vk={fromASN:o(t=>t.valueBlock.toString(),"fromASN"),toASN:o(t=>new mn({value:t}),"toASN")},bk={fromASN:o(t=>t.valueBlock.value,"fromASN"),toASN:o(t=>new hn({value:t}),"toASN")},wk={fromASN:o(t=>t.valueBlock.valueHexView,"fromASN"),toASN:o(t=>new ut({valueHex:t}),"toASN")};function sr(t){return{fromASN:o(e=>e.valueBlock.value,"fromASN"),toASN:o(e=>new t({value:e}),"toASN")}}o(sr,"createStringConverter");var Pm=sr(Bt),_k=sr(gn),xk=sr(vn),Ak=sr(bn),Sk=sr(wn),kk=sr(_n),Ck=sr(xn),Ek=sr(An),Pk=sr(Sn),Tk=sr(Lr),Ik=sr(kn),Ok=sr(Cn),Rk={fromASN:o(t=>t.toDate(),"fromASN"),toASN:o(t=>new Hr({valueDate:t}),"toASN")},jk={fromASN:o(t=>t.toDate(),"fromASN"),toASN:o(t=>new En({valueDate:t}),"toASN")},Nk={fromASN:o(()=>null,"fromASN"),toASN:o(()=>new st,"toASN")};function Wi(t){switch(t){case le.Any:return hk;case le.BitString:return gk;case le.BmpString:return _k;case le.Boolean:return bk;case le.CharacterString:return Ok;case le.Enumerated:return mk;case le.GeneralString:return Ik;case le.GeneralizedTime:return jk;case le.GraphicString:return Pk;case le.IA5String:return Ek;case le.Integer:return yk;case le.Null:return Nk;case le.NumericString:return Ak;case le.ObjectIdentifier:return vk;case le.OctetString:return wk;case le.PrintableString:return Sk;case le.TeletexString:return kk;case le.UTCTime:return Rk;case le.UniversalString:return xk;case le.Utf8String:return Pm;case le.VideotexString:return Ck;case le.VisibleString:return Tk;default:return null}}o(Wi,"defaultConverter");function ur(t){return typeof t=="function"&&t.prototype?t.prototype.toASN&&t.prototype.fromASN?!0:ur(t.prototype):!!(t&&typeof t=="object"&&"toASN"in t&&"fromASN"in t)}o(ur,"isConvertible");function Im(t){var e;if(t){let r=Object.getPrototypeOf(t);return((e=r?.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:Im(r)}return!1}o(Im,"isTypeOfArray");function H_(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)if(r[i]!==n[i])return!1;return!0}o(H_,"isArrayEqual");var Om=class Om{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,r=!1){let n=this.items.get(e);if(!n)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(r&&!n.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(e){let r=this.get(e);r.schema||(r.schema=this.create(e,!0))}createDefault(e){let r={type:qe.Sequence,items:{}},n=this.findParentSchema(e);return n&&(Object.assign(r,n),r.items=Object.assign({},r.items,n.items)),r}create(e,r){let n=this.items.get(e)||this.createDefault(e),i=[];for(let s in n.items){let u=n.items[s],a=r?s:"",c;if(typeof u.type=="number"){let h=le[u.type],y=Ze[h];if(!y)throw new Error(`Cannot get ASN1 class by name '${h}'`);c=new y({name:a})}else ur(u.type)?c=new u.type().toSchema(a):u.optional?this.get(u.type).type===qe.Choice?c=new Jt({name:a}):(c=this.create(u.type,!1),c.name=a):c=new Jt({name:a});let d=!!u.optional||u.defaultValue!==void 0;if(u.repeated){c.name="";let h=u.repeated==="set"?ke:_e;c=new h({name:"",value:[new Pn({name:a,value:c})]})}if(u.context!==null&&u.context!==void 0)if(u.implicit)if(typeof u.type=="number"||ur(u.type)){let h=u.repeated?me:Kt;i.push(new h({name:a,optional:d,idBlock:{tagClass:3,tagNumber:u.context}}))}else{this.cache(u.type);let h=!!u.repeated,y=h?c:this.get(u.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,i.push(new me({name:h?"":a,optional:d,idBlock:{tagClass:3,tagNumber:u.context},value:y}))}else i.push(new me({optional:d,idBlock:{tagClass:3,tagNumber:u.context},value:[c]}));else c.optional=d,i.push(c)}switch(n.type){case qe.Sequence:return new _e({value:i,name:""});case qe.Set:return new ke({value:i,name:""});case qe.Choice:return new oi({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,r){return this.items.set(e,r),this}findParentSchema(e){let r=Object.getPrototypeOf(e);return r?this.items.get(r)||this.findParentSchema(r):null}};o(Om,"AsnSchemaStorage");var ul=Om;var ar=new ul;var Rm=class Rm extends Error{constructor(){super(...arguments),this.schemas=[]}};o(Rm,"AsnSchemaValidationError");var si=Rm;var jm=class jm{static parse(e,r){let n=at(e);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r)}static fromASN(e,r){try{if(ur(r))return new r().fromASN(e);let n=ar.get(r);ar.cache(r);let i=n.schema,s=this.handleChoiceTypes(e,n,r,i);if(s?.result)return s.result;s?.targetSchema&&(i=s.targetSchema);let u=this.handleSequenceTypes(e,n,r,i),a=new r;return Im(r)?this.handleArrayTypes(e,n,r):(this.processSchemaItems(n,u,a),a)}catch(n){throw n instanceof si&&n.schemas.push(r.name),n}}static handleChoiceTypes(e,r,n,i){if(e.constructor===me&&r.type===qe.Choice&&e.idBlock.tagClass===3)for(let s in r.items){let u=r.items[s];if(u.context===e.idBlock.tagNumber&&u.implicit&&typeof u.type=="function"&&ar.has(u.type)){let a=ar.get(u.type);if(a&&a.type===qe.Sequence){let c=new _e;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in c.valueBlock){c.valueBlock.value=e.valueBlock.value;let d=this.fromASN(c,u.type),h=new n;return h[s]=d,{result:h}}}}}else if(e.constructor===me&&r.type!==qe.Choice){let s=new me({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:r.schema.valueBlock.value});for(let u in r.items)delete e[u];return{targetSchema:s}}return null}static handleSequenceTypes(e,r,n,i){if(r.type===qe.Sequence){let s=or({},e,i);if(!s.verified)throw new si(`Data does not match to ${n.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{let s=or({},e,i);if(!s.verified)throw new si(`Data does not match to ${n.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,r,n){let i=e.slice(r);if(i.length===1&&i[0].constructor.name==="Sequence"){let s=i[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(i=s.valueBlock.value)}if(typeof n.type=="number"){let s=Wi(n.type);if(!s)throw new Error(`No converter for ASN.1 type ${n.type}`);return i.filter(u=>u&&u.valueBlock).map(u=>{try{return s.fromASN(u)}catch{return}}).filter(u=>u!==void 0)}else return i.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,n.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,r){let n=Wi(r.type);if(!n)throw new Error(`No converter for ASN.1 type ${r.type}`);return n.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&ar.has(e.type)&&ar.get(e.type).type===qe.Choice}static processOptionalChoiceField(e,r){try{return{processed:!0,value:this.fromASN(e,r.type)}}catch(n){if(n instanceof si&&/Wrong values for Choice type/.test(n.message))return{processed:!1};throw n}}static handleArrayTypes(e,r,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=r.itemType;if(typeof i=="number"){let s=Wi(i);if(!s)throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`);return n.from(e.valueBlock.value,u=>s.fromASN(u))}else return n.from(e.valueBlock.value,s=>this.fromASN(s,i))}static processSchemaItems(e,r,n){for(let i in e.items){let s=r.result[i];if(!s)continue;let u=e.items[i],a=u.type,c;typeof a=="number"||ur(a)?c=this.processPrimitiveSchemaItem(s,u,a):c=this.processComplexSchemaItem(s,u,a),c&&typeof c=="object"&&"value"in c&&"raw"in c?(n[i]=c.value,n[`${i}Raw`]=c.raw):n[i]=c}}static processPrimitiveSchemaItem(e,r,n){var i;let s=(i=r.converter)!==null&&i!==void 0?i:ur(n)?new n:null;if(!s)throw new Error("Converter is empty");return r.repeated?this.processRepeatedPrimitiveItem(e,r,s):this.processSinglePrimitiveItem(e,r,n,s)}static processRepeatedPrimitiveItem(e,r,n){if(r.implicit){let i=r.repeated==="sequence"?_e:ke,s=new i;s.valueBlock=e.valueBlock;let u=at(s.toBER(!1));if(u.offset===-1)throw new Error(`Cannot parse the child item. ${u.result.error}`);if(!("value"in u.result.valueBlock&&Array.isArray(u.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let a=u.result.valueBlock.value;return Array.from(a,c=>n.fromASN(c))}else return Array.from(e,i=>n.fromASN(i))}static processSinglePrimitiveItem(e,r,n,i){let s=e;if(r.implicit){let u;if(ur(n))u=new n().toSchema("");else{let a=le[n],c=Ze[a];if(!c)throw new Error(`Cannot get '${a}' class from asn1js module`);u=new c}u.valueBlock=s.valueBlock,s=at(u.toBER(!1)).result}return i.fromASN(s)}static processComplexSchemaItem(e,r,n){if(r.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,r,n);if(this.isOptionalChoiceField(r))try{return this.fromASN(i,n)}catch(s){if(s instanceof si&&/Wrong values for Choice type/.test(s.message))return;throw s}else{let s=this.fromASN(i,n);return r.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,r,n){if(r.implicit&&typeof r.context=="number"){let i=ar.get(n);if(i.type===qe.Sequence){let s=new _e;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(i.type===qe.Set){let s=new ke;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}};o(jm,"AsnParser");var Pc=jm;var al=class al{static serialize(e){return e instanceof De?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&ur(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let r=e.constructor,n=ar.get(r);ar.cache(r);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 u=Wi(n.itemType);if(!u)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);i=e.map(a=>u.toASN(a))}else i=e.map(u=>this.toAsnItem({type:n.itemType},"[]",r,u))}else for(let u in n.items){let a=n.items[u],c=e[u];if(c===void 0||a.defaultValue===c||typeof a.defaultValue=="object"&&typeof c=="object"&&H_(this.serialize(a.defaultValue),this.serialize(c)))continue;let d=al.toAsnItem(a,u,r,c);if(typeof a.context=="number")if(a.implicit)if(!a.repeated&&(typeof a.type=="number"||ur(a.type))){let h={};h.valueHex=d instanceof st?d.valueBeforeDecodeView:d.valueBlock.toBER(),i.push(new Kt({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},...h}))}else i.push(new me({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:d.valueBlock.value}));else i.push(new me({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:[d]}));else a.repeated?i=i.concat(d):i.push(d)}let s;switch(n.type){case qe.Sequence:s=new _e({value:i});break;case qe.Set:s=new ke({value:i});break;case qe.Choice:if(!i[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=i[0];break}return s}static toAsnItem(e,r,n,i){let s;if(typeof e.type=="number"){let u=e.converter;if(!u)throw new Error(`Property '${r}' doesn't have converter for type ${le[e.type]} in schema '${n.name}'`);if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let a=Array.from(i,d=>u.toASN(d)),c=e.repeated==="sequence"?_e:ke;s=new c({value:a})}else s=u.toASN(i)}else if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let u=Array.from(i,c=>this.toASN(c)),a=e.repeated==="sequence"?_e:ke;s=new a({value:u})}else s=this.toASN(i);return s}};o(al,"AsnSerializer");var Tc=al;var Nm=Ui(Ko());var cl=class cl{static serialize(e){return Tc.serialize(e)}static parse(e,r){return Pc.parse(e,r)}static toString(e){let r=Nm.BufferSourceConverter.isBufferSource(e)?Nm.BufferSourceConverter.toArrayBuffer(e):cl.serialize(e),n=at(r);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}};o(cl,"AsnConvert");var j=cl;function f(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(u=t[a])&&(s=(i<3?u(s):i>3?u(e,r,s):u(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}o(f,"__decorate");function Z(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}o(Z,"__classPrivateFieldGet");function Ce(t,e,r,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"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}o(Ce,"__classPrivateFieldSet");var Bk="[object ArrayBuffer]",Dk="[object SharedArrayBuffer]";function W_(t){return Object.prototype.toString.call(t)}o(W_,"tagOf");function qk(t){if(ArrayBuffer.isView(t))return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.byteOffset=="number"&&typeof e.byteLength=="number"&&fl(e.buffer)}o(qk,"isArrayBufferViewLike");function Bm(t){return W_(t)===Bk}o(Bm,"isArrayBuffer");function F_(t){return typeof SharedArrayBuffer<"u"&&W_(t)===Dk}o(F_,"isSharedArrayBuffer");function fl(t){return Bm(t)||F_(t)}o(fl,"isArrayBufferLike");function z_(t){return qk(t)}o(z_,"isArrayBufferView");function In(t){return fl(t)||z_(t)}o(In,"isBufferSource");function Dm(t){if(!In(t))throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}o(Dm,"assertBufferSource");function cr(t){return Dm(t),fl(t)?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}o(cr,"toUint8Array");function Qe(t){if(Dm(t),Bm(t))return t;let e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(cr(t)),e}o(Qe,"toArrayBuffer");function qm(t,e,r={}){let n=cr(t),i=cr(e);if(!r.constantTime&&n.byteLength!==i.byteLength)return!1;let s=Math.max(n.byteLength,i.byteLength),u=n.byteLength^i.byteLength;for(let a=0;a<s;a++)u|=(n[a]??0)^(i[a]??0);return u===0}o(qm,"equal");var v;(function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice"})(v||(v={}));var m;(function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null"})(m||(m={}));var Mm=class Mm{constructor(e,r=0){l(this,"unusedBits",0);l(this,"value",new ArrayBuffer(0));if(e)if(typeof e=="number")this.fromNumber(e);else if(In(e))this.unusedBits=r,this.value=Qe(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Nt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=Qe(e.valueBlock.valueHex),this}toASN(){return new Nt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Nt({name:e})}toNumber(){let e="",r=new Uint8Array(this.value);for(let n of r)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 r=e.toString(2),n=r.length+7>>3;this.unusedBits=(n<<3)-r.length;let i=new Uint8Array(n);r=r.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)i[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=i.buffer}};o(Mm,"BitString");var Fr=Mm;var Um=class Um{constructor(e){l(this,"buffer");typeof e=="number"?this.buffer=new ArrayBuffer(e):In(e)?this.buffer=Qe(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 ut))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=Qe(e.valueBlock.valueHex),this}toASN(){return new ut({valueHex:this.buffer})}toSchema(e){return new ut({name:e})}};o(Um,"OctetString");var F=Um;var $k={fromASN:o(t=>t instanceof st?null:Qe(t.valueBeforeDecodeView),"fromASN"),toASN:o(t=>{if(t===null)return new st;let e=at(t);if(e.result.error)throw new Error(e.result.error);return e.result},"toASN")},Vk={fromASN:o(t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,"fromASN"),toASN:o(t=>new kr({value:+t}),"toASN")},Lk={fromASN:o(t=>t.valueBlock.valueDec,"fromASN"),toASN:o(t=>new yn({value:t}),"toASN")},ie={fromASN:o(t=>Qe(t.valueBlock.valueHexView),"fromASN"),toASN:o(t=>new kr({valueHex:t}),"toASN")};var Hk={fromASN:o(t=>Qe(t.valueBlock.valueHexView),"fromASN"),toASN:o(t=>new Nt({valueHex:t}),"toASN")},Wk={fromASN:o(t=>t.valueBlock.toString(),"fromASN"),toASN:o(t=>new mn({value:t}),"toASN")},Fk={fromASN:o(t=>t.valueBlock.value,"fromASN"),toASN:o(t=>new hn({value:t}),"toASN")},Xo={fromASN:o(t=>Qe(t.valueBlock.valueHexView),"fromASN"),toASN:o(t=>new ut({valueHex:t}),"toASN")},K_={fromASN:o(t=>new F(t.getValue()),"fromASN"),toASN:o(t=>t.toASN(),"toASN")};function fr(t){return{fromASN:o(e=>e.valueBlock.value,"fromASN"),toASN:o(e=>new t({value:e}),"toASN")}}o(fr,"createStringConverter");var zk=fr(Bt),Kk=fr(gn),Jk=fr(vn),Gk=fr(bn),Xk=fr(wn),Zk=fr(_n),Qk=fr(xn),Yk=fr(An),eC=fr(Sn),tC=fr(Lr),rC=fr(kn),nC=fr(Cn),iC={fromASN:o(t=>t.toDate(),"fromASN"),toASN:o(t=>new Hr({valueDate:t}),"toASN")},oC={fromASN:o(t=>t.toDate(),"fromASN"),toASN:o(t=>new En({valueDate:t}),"toASN")},sC={fromASN:o(()=>null,"fromASN"),toASN:o(()=>new st,"toASN")};function ui(t){switch(t){case m.Any:return $k;case m.BitString:return Hk;case m.BmpString:return Kk;case m.Boolean:return Fk;case m.CharacterString:return nC;case m.Enumerated:return Lk;case m.GeneralString:return rC;case m.GeneralizedTime:return oC;case m.GraphicString:return eC;case m.IA5String:return Yk;case m.Integer:return Vk;case m.Null:return sC;case m.NumericString:return Gk;case m.ObjectIdentifier:return Wk;case m.OctetString:return Xo;case m.PrintableString:return Xk;case m.TeletexString:return Zk;case m.UTCTime:return iC;case m.UniversalString:return Jk;case m.Utf8String:return zk;case m.VideotexString:return Qk;case m.VisibleString:return tC;default:return null}}o(ui,"defaultConverter");function dr(t){return typeof t=="function"&&t.prototype?t.prototype.toASN&&t.prototype.fromASN?!0:dr(t.prototype):!!(t&&typeof t=="object"&&"toASN"in t&&"fromASN"in t)}o(dr,"isConvertible");function Vm(t){if(t){let e=Object.getPrototypeOf(t);return e?.prototype?.constructor===Array?!0:Vm(e)}return!1}o(Vm,"isTypeOfArray");function J_(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)if(r[i]!==n[i])return!1;return!0}o(J_,"isArrayEqual");var Lm=class Lm{constructor(){l(this,"items",new WeakMap)}has(e){return this.items.has(e)}get(e,r=!1){let n=this.items.get(e);if(!n)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(r&&!n.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(e){let r=this.get(e);r.schema||(r.schema=this.create(e,!0))}createDefault(e){let r={type:v.Sequence,items:{}},n=this.findParentSchema(e);return n&&(Object.assign(r,n),r.items=Object.assign({},r.items,n.items)),r}create(e,r){let n=this.items.get(e)||this.createDefault(e),i=[];for(let s in n.items){let u=n.items[s],a=r?s:"",c;if(typeof u.type=="number"){let h=m[u.type],y=Ze[h];if(!y)throw new Error(`Cannot get ASN1 class by name '${h}'`);c=new y({name:a})}else dr(u.type)?c=new u.type().toSchema(a):u.optional?this.get(u.type).type===v.Choice?c=new Jt({name:a}):(c=this.create(u.type,!1),c.name=a):c=new Jt({name:a});let d=!!u.optional||u.defaultValue!==void 0;if(u.repeated){c.name="";let h=u.repeated==="set"?ke:_e;c=new h({name:"",value:[new Pn({name:a,value:c})]})}if(u.context!==null&&u.context!==void 0)if(u.implicit)if(typeof u.type=="number"||dr(u.type)){let h=u.repeated?me:Kt;i.push(new h({name:a,optional:d,idBlock:{tagClass:3,tagNumber:u.context}}))}else{this.cache(u.type);let h=!!u.repeated,y=h?c:this.get(u.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,i.push(new me({name:h?"":a,optional:d,idBlock:{tagClass:3,tagNumber:u.context},value:y}))}else i.push(new me({optional:d,idBlock:{tagClass:3,tagNumber:u.context},value:[c]}));else c.optional=d,i.push(c)}switch(n.type){case v.Sequence:return new _e({value:i,name:""});case v.Set:return new ke({value:i,name:""});case v.Choice:return new oi({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,r){return this.items.set(e,r),this}findParentSchema(e){let r=Object.getPrototypeOf(e);return r?this.items.get(r)||this.findParentSchema(r):null}};o(Lm,"AsnSchemaStorage");var dl=Lm;var ze=new dl;var w=o(t=>e=>{let r;ze.has(e)?r=ze.get(e):(r=ze.createDefault(e),ze.set(e,r)),Object.assign(r,t)},"AsnType");var p=o(t=>(e,r)=>{let n;ze.has(e.constructor)?n=ze.get(e.constructor):(n=ze.createDefault(e.constructor),ze.set(e.constructor,n));let i=Object.assign({},t);if(typeof i.type=="number"&&!i.converter){let s=ui(t.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);i.converter=s}i.raw=t.raw,n.items[r]=i},"AsnProp");var Hm=class Hm extends Error{constructor(){super(...arguments);l(this,"schemas",[])}};o(Hm,"AsnSchemaValidationError");var ai=Hm;var Wm=class Wm{static parse(e,r){let n=at(Qe(e));if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r)}static fromASN(e,r){try{if(dr(r))return new r().fromASN(e);let n=ze.get(r);ze.cache(r);let i=n.schema,s=this.handleChoiceTypes(e,n,r,i);if(s?.result)return s.result;s?.targetSchema&&(i=s.targetSchema);let u=this.handleSequenceTypes(e,n,r,i),a=new r;return Vm(r)?this.handleArrayTypes(e,n,r):(this.processSchemaItems(n,u,a),a)}catch(n){throw n instanceof ai&&n.schemas.push(r.name),n}}static handleChoiceTypes(e,r,n,i){if(e.constructor===me&&r.type===v.Choice&&e.idBlock.tagClass===3)for(let s in r.items){let u=r.items[s];if(u.context===e.idBlock.tagNumber&&u.implicit&&typeof u.type=="function"&&ze.has(u.type)){let a=ze.get(u.type);if(a&&a.type===v.Sequence){let c=new _e;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in c.valueBlock){c.valueBlock.value=e.valueBlock.value;let d=this.fromASN(c,u.type),h=new n;return h[s]=d,{result:h}}}}}else if(e.constructor===me&&r.type!==v.Choice){let s=new me({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:r.schema.valueBlock.value});for(let u in r.items)delete e[u];return{targetSchema:s}}return null}static handleSequenceTypes(e,r,n,i){if(r.type===v.Sequence){let s=or({},e,i);if(!s.verified)throw new ai(`Data does not match to ${n.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{let s=or({},e,i);if(!s.verified)throw new ai(`Data does not match to ${n.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,r,n){let i=e.slice(r);if(i.length===1&&i[0].constructor.name==="Sequence"){let s=i[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(i=s.valueBlock.value)}if(typeof n.type=="number"){let s=ui(n.type);if(!s)throw new Error(`No converter for ASN.1 type ${n.type}`);return i.filter(u=>u&&u.valueBlock).map(u=>{try{return s.fromASN(u)}catch{return}}).filter(u=>u!==void 0)}else return i.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,n.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,r){let n=ui(r.type);if(!n)throw new Error(`No converter for ASN.1 type ${r.type}`);return n.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&ze.has(e.type)&&ze.get(e.type).type===v.Choice}static processOptionalChoiceField(e,r){try{return{processed:!0,value:this.fromASN(e,r.type)}}catch(n){if(n instanceof ai&&/Wrong values for Choice type/.test(n.message))return{processed:!1};throw n}}static handleArrayTypes(e,r,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=r.itemType;if(typeof i=="number"){let s=ui(i);if(!s)throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`);return n.from(e.valueBlock.value,u=>s.fromASN(u))}else return n.from(e.valueBlock.value,s=>this.fromASN(s,i))}static processSchemaItems(e,r,n){for(let i in e.items){let s=r.result[i];if(!s)continue;let u=e.items[i],a=u.type,c;typeof a=="number"||dr(a)?c=this.processPrimitiveSchemaItem(s,u,a):c=this.processComplexSchemaItem(s,u,a),c&&typeof c=="object"&&"value"in c&&"raw"in c?(n[i]=c.value,n[`${i}Raw`]=c.raw):n[i]=c}}static processPrimitiveSchemaItem(e,r,n){let i=r.converter??(dr(n)?new n:null);if(!i)throw new Error("Converter is empty");return r.repeated?this.processRepeatedPrimitiveItem(e,r,i):this.processSinglePrimitiveItem(e,r,n,i)}static processRepeatedPrimitiveItem(e,r,n){if(r.implicit){let i=r.repeated==="sequence"?_e:ke,s=new i;s.valueBlock=e.valueBlock;let u=at(s.toBER(!1));if(u.offset===-1)throw new Error(`Cannot parse the child item. ${u.result.error}`);if(!("value"in u.result.valueBlock&&Array.isArray(u.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let a=u.result.valueBlock.value;return Array.from(a,c=>n.fromASN(c))}else return Array.from(e,i=>n.fromASN(i))}static processSinglePrimitiveItem(e,r,n,i){let s=e;if(r.implicit){let u;if(dr(n))u=new n().toSchema("");else{let a=m[n],c=Ze[a];if(!c)throw new Error(`Cannot get '${a}' class from asn1js module`);u=new c}u.valueBlock=s.valueBlock,s=at(u.toBER(!1)).result}return i.fromASN(s)}static processComplexSchemaItem(e,r,n){if(r.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,r,n);if(this.isOptionalChoiceField(r))try{return this.fromASN(i,n)}catch(s){if(s instanceof ai&&/Wrong values for Choice type/.test(s.message))return;throw s}else{let s=this.fromASN(i,n);return r.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,r,n){if(r.implicit&&typeof r.context=="number"){let i=ze.get(n);if(i.type===v.Sequence){let s=new _e;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(i.type===v.Set){let s=new ke;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}};o(Wm,"AsnParser");var Ic=Wm;var ll=class ll{static serialize(e){return e instanceof De?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&dr(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let r=e.constructor,n=ze.get(r);ze.cache(r);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 u=ui(n.itemType);if(!u)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);i=e.map(a=>u.toASN(a))}else i=e.map(u=>this.toAsnItem({type:n.itemType},"[]",r,u))}else for(let u in n.items){let a=n.items[u],c=e[u];if(c===void 0||a.defaultValue===c||typeof a.defaultValue=="object"&&typeof c=="object"&&J_(this.serialize(a.defaultValue),this.serialize(c)))continue;let d=ll.toAsnItem(a,u,r,c);if(typeof a.context=="number")if(a.implicit)if(!a.repeated&&(typeof a.type=="number"||dr(a.type))){let h={};h.valueHex=d instanceof st?Qe(d.valueBeforeDecodeView):d.valueBlock.toBER(),i.push(new Kt({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},...h}))}else i.push(new me({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:d.valueBlock.value}));else i.push(new me({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:[d]}));else a.repeated?i=i.concat(d):i.push(d)}let s;switch(n.type){case v.Sequence:s=new _e({value:i});break;case v.Set:s=new ke({value:i});break;case v.Choice:if(!i[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=i[0];break}return s}static toAsnItem(e,r,n,i){let s;if(typeof e.type=="number"){let u=e.converter;if(!u)throw new Error(`Property '${r}' doesn't have converter for type ${m[e.type]} in schema '${n.name}'`);if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let a=Array.from(i,d=>u.toASN(d)),c=e.repeated==="sequence"?_e:ke;s=new c({value:a})}else s=u.toASN(i)}else if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");let u=Array.from(i,c=>this.toASN(c)),a=e.repeated==="sequence"?_e:ke;s=new a({value:u})}else s=this.toASN(i);return s}};o(ll,"AsnSerializer");var Oc=ll;var Fm=class Fm extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(let r of e)this.push(r)}}};o(Fm,"AsnArray");var $=Fm;var pl=class pl{static serialize(e){return Oc.serialize(e)}static parse(e,r){return Ic.parse(e,r)}static toString(e){let r=In(e)?Qe(e):pl.serialize(e),n=at(r);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}};o(pl,"AsnConvert");var Er=pl;var Zo={};lh(Zo,{decode:()=>Km,encode:()=>zm,format:()=>Y_,formats:()=>e2,hex:()=>vC,is:()=>Z_,normalize:()=>Rc,parse:()=>Q_});var aC=/^[0-9a-f]$/i,cC=[" "," ",`
|
|
15
|
+
`,"\r",":","-","."];function fC(t){return t.separators==="none"?[]:!t.separators||t.separators==="common"?cC:t.separators}o(fC,"resolveSeparators");function dC(t){if(!t)throw new TypeError("Hex separators must be non-empty strings")}o(dC,"validateSeparator");function lC(t,e,r){for(let n of r)if(t.startsWith(n,e))return n}o(lC,"matchSeparator");function pC(t){let e=/[A-F]/.test(t),r=/[a-f]/.test(t);return e&&!r?"upper":"lower"}o(pC,"detectCase");function hC(t){let e=/\r\n|\n/.exec(t);if(e)return e[0]===`\r
|
|
16
|
+
`?`\r
|
|
17
|
+
`:`
|
|
18
|
+
`}o(hC,"detectLineSeparator");function G_(t){return t.replace(/[^0-9a-f]/gi,"")}o(G_,"compactForDetection");function yC(t){let e=t.match(/[0-9A-Fa-f]+|[^0-9A-Fa-f]+/g)??[];if(e.length<3)return;let r=e.filter((u,a)=>a%2===0),n=e.filter((u,a)=>a%2===1),i=n[0];if(!i||n.some(u=>u!==i)||r.some(u=>u.length===0||u.length%2!==0))return;let s=r[0]?.length??0;if(s&&!r.slice(0,-1).some(u=>u.length!==s)&&!((r[r.length-1]?.length??0)>s))return{size:s/2,separator:i}}o(yC,"detectGroup");function mC(t){let e=t.trim(),r=/^0x/i.test(e)?"0x":"",n=r?e.slice(2):e,i=hC(n),s=n.split(/\r\n|\n/).filter(d=>d.length>0),u=s[0]?.trim()??"",a=yC(u),c={case:pC(e),prefix:r};if(a&&(c.group=a),i&&s.length>1){let d=G_(s[0]??"").length/2;d>0&&s.slice(0,-1).every(h=>G_(h).length/2===d)&&(c.line={bytesPerLine:d,separator:i})}return c}o(mC,"detectFormat");function gC(t,e){let r=e.allowPrefix??!0,n=[...fC(e)].sort((a,c)=>c.length-a.length);for(let a of n)dC(a);let i=t.trim();if(/^0x/i.test(i)){if(!r)throw new TypeError("Hexadecimal text must not include a 0x prefix");i=i.slice(2)}let s="",u=!1;for(let a=0;a<i.length;){let c=i[a]??"";if(aC.test(c)){s+=c,u=!1,a+=1;continue}let d=lC(i,a,n);if(!d)throw new TypeError("Input is not valid hexadecimal text");if(e.strict&&(u||s.length===0))throw new TypeError("Hexadecimal text contains misplaced separators");u=!0,a+=d.length}if(e.strict&&u&&s.length>0)throw new TypeError("Hexadecimal text must not end with a separator");if(s.length%2!==0){if(!e.allowOddLength)throw new TypeError("Hexadecimal text must contain an even number of characters");s=`0${s}`}return s.toLowerCase()}o(gC,"normalizeText");function X_(t,e){if(!e)return t.join("");if(!Number.isInteger(e.size)||e.size<1)throw new RangeError("Hex group size must be a positive integer");let r=[];for(let n=0;n<t.length;n+=e.size)r.push(t.slice(n,n+e.size).join(""));return r.join(e.separator)}o(X_,"groupPairs");function Rc(t,e={}){return gC(t,e)}o(Rc,"normalize");function Z_(t,e={}){if(typeof t!="string")return!1;try{return Rc(t,e),!0}catch{return!1}}o(Z_,"is");function zm(t,e={}){let r=cr(t),n=e.case??"lower",i=Array.from(r,u=>{let a=u.toString(16).padStart(2,"0");return n==="upper"?a.toUpperCase():a}),s="";if(e.line){let u=e.line.bytesPerLine;if(!Number.isInteger(u)||u<1)throw new RangeError("Hex bytesPerLine must be a positive integer");let a=e.line.separator??`
|
|
19
|
+
`,c=[];for(let d=0;d<i.length;d+=u)c.push(X_(i.slice(d,d+u),e.group));s=c.join(a)}else s=X_(i,e.group);return`${e.prefix??""}${s}`}o(zm,"encode");function Km(t,e={}){let r=Rc(t,e),n=new Uint8Array(r.length/2);for(let i=0;i<r.length;i+=2)n[i/2]=Number.parseInt(r.slice(i,i+2),16);return n}o(Km,"decode");function Q_(t,e={}){let r=Rc(t,e);return{bytes:Km(r),format:mC(t),normalized:r}}o(Q_,"parse");function Y_(t,e){return zm(t,e)}o(Y_,"format");var e2={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"})},vC={encode:zm,decode:Km,format:Y_,formats:e2,is:Z_,normalize:Rc,parse:Q_};var Jm=class Jm{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let r=e.split(".");if(r.length!==4)throw new Error("Invalid IPv4 address");return r.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,s)=>{let u=parseInt(s,16);if(isNaN(u)||u<0||u>65535)throw new Error("Invalid IPv6 address part");return i.push(u>>8&255),i.push(u&255),i},[])}static expandIPv6(e){if(!e.includes("::"))return e;let r=e.split("::");if(r.length>2)throw new Error("Invalid IPv6 address");let n=r[0]?r[0].split(":"):[],i=r[1]?r[1].split(":"):[],s=8-(n.length+i.length);if(s<0)throw new Error("Invalid IPv6 address");return[...n,...Array(s).fill("0"),...i].join(":")}static formatIPv6(e){let r=[];for(let n=0;n<16;n+=2)r.push((e[n]<<8|e[n+1]).toString(16));return this.compressIPv6(r.join(":"))}static compressIPv6(e){let r=e.split(":"),n=-1,i=0,s=-1,u=0;for(let a=0;a<r.length;a++)r[a]==="0"?(s===-1&&(s=a),u++):(u>i&&(n=s,i=u),s=-1,u=0);if(u>i&&(n=s,i=u),i>1){let a=r.slice(0,n).join(":"),c=r.slice(n+i).join(":");return`${a}::${c}`}return e}static parseCIDR(e){let[r,n]=e.split("/"),i=parseInt(n,10);if(this.isIPv4(r)){if(i<0||i>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(r),i]}else{if(i<0||i>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(r),i]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;let r=parseInt(e.slice(8),16).toString(2).split("").reduce((i,s)=>i+ +s,0),n=e.slice(0,8).replace(/(.{2})/g,i=>`${parseInt(i,16)}.`);return n=n.slice(0,-1),`${n}/${r}`}static toString(e){let r=new Uint8Array(e);if(r.length===4)return Array.from(r).join(".");if(r.length===16)return this.formatIPv6(r);if(r.length===8||r.length===32){let n=r.length/2,i=r.slice(0,n),s=r.slice(n);if(r.every(c=>c===0))return r.length===8?"0.0.0.0/0":"::/0";let a=s.reduce((c,d)=>c+(d.toString(2).match(/1/g)||[]).length,0);return r.length===8?`${Array.from(i).join(".")}/${a}`:`${this.formatIPv6(i)}/${a}`}return this.decodeIP(Zo.encode(e))}static fromString(e){if(e.includes("/")){let[n,i]=this.parseCIDR(e),s=new Uint8Array(n.length),u=i;for(let c=0;c<s.length;c++)u>=8?(s[c]=255,u-=8):u>0&&(s[c]=255<<8-u,u=0);let a=new Uint8Array(n.length*2);return a.set(n,0),a.set(s,n.length),a.buffer}let r=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(r).buffer}};o(Jm,"IpConverter");var jc=Jm;var Gm,Xm,Zm,Qo,Ke=(Qo=class{constructor(e={}){l(this,"teletexString");l(this,"printableString");l(this,"universalString");l(this,"utf8String");l(this,"bmpString");Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}},o(Qo,"DirectoryString"),Qo);f([p({type:m.TeletexString})],Ke.prototype,"teletexString",void 0);f([p({type:m.PrintableString})],Ke.prototype,"printableString",void 0);f([p({type:m.UniversalString})],Ke.prototype,"universalString",void 0);f([p({type:m.Utf8String})],Ke.prototype,"utf8String",void 0);f([p({type:m.BmpString})],Ke.prototype,"bmpString",void 0);Ke=f([w({type:v.Choice})],Ke);var Yo,ns=(Yo=class extends Ke{constructor(r={}){super(r);l(this,"ia5String");l(this,"anyValue");Object.assign(this,r)}toString(){return this.ia5String||(this.anyValue?Zo.encode(this.anyValue):super.toString())}},o(Yo,"AttributeValue"),Yo);f([p({type:m.IA5String})],ns.prototype,"ia5String",void 0);f([p({type:m.Any})],ns.prototype,"anyValue",void 0);ns=f([w({type:v.Choice})],ns);var Ym=class Ym{constructor(e={}){l(this,"type","");l(this,"value",new ns);Object.assign(this,e)}};o(Ym,"AttributeTypeAndValue");var Fi=Ym;f([p({type:m.ObjectIdentifier})],Fi.prototype,"type",void 0);f([p({type:ns})],Fi.prototype,"value",void 0);var es,ci=Gm=(es=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Gm.prototype)}},o(es,"RelativeDistinguishedName"),es);ci=Gm=f([w({type:v.Set,itemType:Fi})],ci);var ts,Qm=Xm=(ts=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Xm.prototype)}},o(ts,"RDNSequence"),ts);Qm=Xm=f([w({type:v.Sequence,itemType:ci})],Qm);var rs,Ae=Zm=(rs=class extends Qm{constructor(e){super(e),Object.setPrototypeOf(this,Zm.prototype)}},o(rs,"Name"),rs);Ae=Zm=f([w({type:v.Sequence})],Ae);var AC={fromASN:o(t=>jc.toString(Xo.fromASN(t)),"fromASN"),toASN:o(t=>Xo.toASN(jc.fromString(t)),"toASN")},e0=class e0{constructor(e={}){l(this,"typeId","");l(this,"value",new ArrayBuffer(0));Object.assign(this,e)}};o(e0,"OtherName");var fi=e0;f([p({type:m.ObjectIdentifier})],fi.prototype,"typeId",void 0);f([p({type:m.Any,context:0})],fi.prototype,"value",void 0);var t0=class t0{constructor(e={}){l(this,"nameAssigner");l(this,"partyName",new Ke);Object.assign(this,e)}};o(t0,"EDIPartyName");var Nc=t0;f([p({type:Ke,optional:!0,context:0,implicit:!0})],Nc.prototype,"nameAssigner",void 0);f([p({type:Ke,context:1,implicit:!0})],Nc.prototype,"partyName",void 0);var is,W=(is=class{constructor(e={}){l(this,"otherName");l(this,"rfc822Name");l(this,"dNSName");l(this,"x400Address");l(this,"directoryName");l(this,"ediPartyName");l(this,"uniformResourceIdentifier");l(this,"iPAddress");l(this,"registeredID");Object.assign(this,e)}},o(is,"GeneralName"),is);f([p({type:fi,context:0,implicit:!0})],W.prototype,"otherName",void 0);f([p({type:m.IA5String,context:1,implicit:!0})],W.prototype,"rfc822Name",void 0);f([p({type:m.IA5String,context:2,implicit:!0})],W.prototype,"dNSName",void 0);f([p({type:m.Any,context:3,implicit:!0})],W.prototype,"x400Address",void 0);f([p({type:Ae,context:4,implicit:!1})],W.prototype,"directoryName",void 0);f([p({type:Nc,context:5})],W.prototype,"ediPartyName",void 0);f([p({type:m.IA5String,context:6,implicit:!0})],W.prototype,"uniformResourceIdentifier",void 0);f([p({type:m.OctetString,context:7,implicit:!0,converter:AC})],W.prototype,"iPAddress",void 0);f([p({type:m.ObjectIdentifier,context:8,implicit:!0})],W.prototype,"registeredID",void 0);W=f([w({type:v.Choice})],W);var di="1.3.6.1.5.5.7",li=`${di}.1`,t2=`${di}.2`,zi=`${di}.3`,hl=`${di}.48`,Iq=`${t2}.1`,Oq=`${t2}.2`,r0=`${hl}.1`,n0=`${hl}.2`,i0=`${hl}.3`,o0=`${hl}.5`,G="2.5.29";var s0,yl=`${li}.1`,u0=class u0{constructor(e={}){l(this,"accessMethod","");l(this,"accessLocation",new W);Object.assign(this,e)}};o(u0,"AccessDescription");var On=u0;f([p({type:m.ObjectIdentifier})],On.prototype,"accessMethod",void 0);f([p({type:W})],On.prototype,"accessLocation",void 0);var os,Ki=s0=(os=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,s0.prototype)}},o(os,"AuthorityInfoAccessSyntax"),os);Ki=s0=f([w({type:v.Sequence,itemType:On})],Ki);var ml=`${G}.35`,a0=class a0 extends F{};o(a0,"KeyIdentifier");var Ji=a0,c0=class c0{constructor(e={}){l(this,"keyIdentifier");l(this,"authorityCertIssuer");l(this,"authorityCertSerialNumber");e&&Object.assign(this,e)}};o(c0,"AuthorityKeyIdentifier");var zr=c0;f([p({type:Ji,context:0,optional:!0,implicit:!0})],zr.prototype,"keyIdentifier",void 0);f([p({type:W,context:1,optional:!0,implicit:!0,repeated:"sequence"})],zr.prototype,"authorityCertIssuer",void 0);f([p({type:m.Integer,context:2,optional:!0,implicit:!0,converter:ie})],zr.prototype,"authorityCertSerialNumber",void 0);var gl=`${G}.19`,f0=class f0{constructor(e={}){l(this,"cA",!1);l(this,"pathLenConstraint");Object.assign(this,e)}};o(f0,"BasicConstraints");var Gi=f0;f([p({type:m.Boolean,defaultValue:!1})],Gi.prototype,"cA",void 0);f([p({type:m.Integer,optional:!0})],Gi.prototype,"pathLenConstraint",void 0);var d0,ss,Ee=d0=(ss=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,d0.prototype)}},o(ss,"GeneralNames"),ss);Ee=d0=f([w({type:v.Sequence,itemType:W})],Ee);var l0,SC=`${G}.29`,us,r2=l0=(us=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,l0.prototype)}},o(us,"CertificateIssuer"),us);r2=l0=f([w({type:v.Sequence})],r2);var p0,bl=`${G}.32`,fM=`${bl}.0`,as,Rn=(as=class{constructor(e={}){l(this,"ia5String");l(this,"visibleString");l(this,"bmpString");l(this,"utf8String");Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}},o(as,"DisplayText"),as);f([p({type:m.IA5String})],Rn.prototype,"ia5String",void 0);f([p({type:m.VisibleString})],Rn.prototype,"visibleString",void 0);f([p({type:m.BmpString})],Rn.prototype,"bmpString",void 0);f([p({type:m.Utf8String})],Rn.prototype,"utf8String",void 0);Rn=f([w({type:v.Choice})],Rn);var h0=class h0{constructor(e={}){l(this,"organization",new Rn);l(this,"noticeNumbers",[]);Object.assign(this,e)}};o(h0,"NoticeReference");var Bc=h0;f([p({type:Rn})],Bc.prototype,"organization",void 0);f([p({type:m.Integer,repeated:"sequence"})],Bc.prototype,"noticeNumbers",void 0);var y0=class y0{constructor(e={}){l(this,"noticeRef");l(this,"explicitText");Object.assign(this,e)}};o(y0,"UserNotice");var Dc=y0;f([p({type:Bc,optional:!0})],Dc.prototype,"noticeRef",void 0);f([p({type:Rn,optional:!0})],Dc.prototype,"explicitText",void 0);var cs,vl=(cs=class{constructor(e={}){l(this,"cPSuri");l(this,"userNotice");Object.assign(this,e)}},o(cs,"Qualifier"),cs);f([p({type:m.IA5String})],vl.prototype,"cPSuri",void 0);f([p({type:Dc})],vl.prototype,"userNotice",void 0);vl=f([w({type:v.Choice})],vl);var m0=class m0{constructor(e={}){l(this,"policyQualifierId","");l(this,"qualifier",new ArrayBuffer(0));Object.assign(this,e)}};o(m0,"PolicyQualifierInfo");var qc=m0;f([p({type:m.ObjectIdentifier})],qc.prototype,"policyQualifierId",void 0);f([p({type:m.Any})],qc.prototype,"qualifier",void 0);var g0=class g0{constructor(e={}){l(this,"policyIdentifier","");l(this,"policyQualifiers");Object.assign(this,e)}};o(g0,"PolicyInformation");var Xi=g0;f([p({type:m.ObjectIdentifier})],Xi.prototype,"policyIdentifier",void 0);f([p({type:qc,repeated:"sequence",optional:!0})],Xi.prototype,"policyQualifiers",void 0);var fs,Mc=p0=(fs=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,p0.prototype)}},o(fs,"CertificatePolicies"),fs);Mc=p0=f([w({type:v.Sequence,itemType:Xi})],Mc);var mM=`${G}.20`,ds,Uc=(ds=class{constructor(e=0){l(this,"value");this.value=e}},o(ds,"CRLNumber"),ds);f([p({type:m.Integer})],Uc.prototype,"value",void 0);Uc=f([w({type:v.Choice})],Uc);var AM=`${G}.27`,ls,n2=(ls=class extends Uc{},o(ls,"BaseCRLNumber"),ls);n2=f([w({type:v.Choice})],n2);var v0,wl=`${G}.31`,Pr;(function(t){t[t.unused=1]="unused",t[t.keyCompromise=2]="keyCompromise",t[t.cACompromise=4]="cACompromise",t[t.affiliationChanged=8]="affiliationChanged",t[t.superseded=16]="superseded",t[t.cessationOfOperation=32]="cessationOfOperation",t[t.certificateHold=64]="certificateHold",t[t.privilegeWithdrawn=128]="privilegeWithdrawn",t[t.aACompromise=256]="aACompromise"})(Pr||(Pr={}));var b0=class b0 extends Fr{toJSON(){let e=[],r=this.toNumber();return r&Pr.aACompromise&&e.push("aACompromise"),r&Pr.affiliationChanged&&e.push("affiliationChanged"),r&Pr.cACompromise&&e.push("cACompromise"),r&Pr.certificateHold&&e.push("certificateHold"),r&Pr.cessationOfOperation&&e.push("cessationOfOperation"),r&Pr.keyCompromise&&e.push("keyCompromise"),r&Pr.privilegeWithdrawn&&e.push("privilegeWithdrawn"),r&Pr.superseded&&e.push("superseded"),r&Pr.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}};o(b0,"Reason");var $c=b0,ps,jn=(ps=class{constructor(e={}){l(this,"fullName");l(this,"nameRelativeToCRLIssuer");Object.assign(this,e)}},o(ps,"DistributionPointName"),ps);f([p({type:W,context:0,repeated:"sequence",implicit:!0})],jn.prototype,"fullName",void 0);f([p({type:ci,context:1,implicit:!0})],jn.prototype,"nameRelativeToCRLIssuer",void 0);jn=f([w({type:v.Choice})],jn);var w0=class w0{constructor(e={}){l(this,"distributionPoint");l(this,"reasons");l(this,"cRLIssuer");Object.assign(this,e)}};o(w0,"DistributionPoint");var Kr=w0;f([p({type:jn,context:0,optional:!0})],Kr.prototype,"distributionPoint",void 0);f([p({type:$c,context:1,optional:!0,implicit:!0})],Kr.prototype,"reasons",void 0);f([p({type:W,context:2,optional:!0,repeated:"sequence",implicit:!0})],Kr.prototype,"cRLIssuer",void 0);var hs,pi=v0=(hs=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,v0.prototype)}},o(hs,"CRLDistributionPoints"),hs);pi=v0=f([w({type:v.Sequence,itemType:Kr})],pi);var _0,qM=`${G}.46`,ys,i2=_0=(ys=class extends pi{constructor(e){super(e),Object.setPrototypeOf(this,_0.prototype)}},o(ys,"FreshestCRL"),ys);i2=_0=f([w({type:v.Sequence,itemType:Kr})],i2);var WM=`${G}.28`,hi=class hi{constructor(e={}){l(this,"distributionPoint");l(this,"onlyContainsUserCerts",hi.ONLY);l(this,"onlyContainsCACerts",hi.ONLY);l(this,"onlySomeReasons");l(this,"indirectCRL",hi.ONLY);l(this,"onlyContainsAttributeCerts",hi.ONLY);Object.assign(this,e)}};o(hi,"IssuingDistributionPoint"),l(hi,"ONLY",!1);var lr=hi;f([p({type:jn,context:0,optional:!0})],lr.prototype,"distributionPoint",void 0);f([p({type:m.Boolean,context:1,defaultValue:lr.ONLY,implicit:!0})],lr.prototype,"onlyContainsUserCerts",void 0);f([p({type:m.Boolean,context:2,defaultValue:lr.ONLY,implicit:!0})],lr.prototype,"onlyContainsCACerts",void 0);f([p({type:$c,context:3,optional:!0,implicit:!0})],lr.prototype,"onlySomeReasons",void 0);f([p({type:m.Boolean,context:4,defaultValue:lr.ONLY,implicit:!0})],lr.prototype,"indirectCRL",void 0);f([p({type:m.Boolean,context:5,defaultValue:lr.ONLY,implicit:!0})],lr.prototype,"onlyContainsAttributeCerts",void 0);var o2=`${G}.21`,Vc;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(Vc||(Vc={}));var ms,Lc=(ms=class{constructor(e=Vc.unspecified){l(this,"reason",Vc.unspecified);this.reason=e}toJSON(){return Vc[this.reason]}toString(){return this.toJSON()}},o(ms,"CRLReason"),ms);f([p({type:m.Enumerated})],Lc.prototype,"reason",void 0);Lc=f([w({type:v.Choice})],Lc);var x0,_l=`${G}.37`,gs,Hc=x0=(gs=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,x0.prototype)}},o(gs,"ExtendedKeyUsage"),gs);Hc=x0=f([w({type:v.Sequence,itemType:m.ObjectIdentifier})],Hc);var tU=`${_l}.0`,s2=`${zi}.1`,u2=`${zi}.2`,a2=`${zi}.3`,c2=`${zi}.4`,f2=`${zi}.8`,d2=`${zi}.9`;var uU=`${G}.54`,vs,A0=(vs=class{constructor(e=new ArrayBuffer(0)){l(this,"value");this.value=e}},o(vs,"InhibitAnyPolicy"),vs);f([p({type:m.Integer,converter:ie})],A0.prototype,"value",void 0);A0=f([w({type:v.Choice})],A0);var l2=`${G}.24`,bs,Wc=(bs=class{constructor(e){l(this,"value",new Date);e&&(this.value=e)}},o(bs,"InvalidityDate"),bs);f([p({type:m.GeneralizedTime})],Wc.prototype,"value",void 0);Wc=f([w({type:v.Choice})],Wc);var S0,k0=`${G}.18`,ws,p2=S0=(ws=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,S0.prototype)}},o(ws,"IssueAlternativeName"),ws);p2=S0=f([w({type:v.Sequence})],p2);var xl=`${G}.15`,Tr;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(Tr||(Tr={}));var C0=class C0 extends Fr{toJSON(){let e=this.toNumber(),r=[];return e&Tr.cRLSign&&r.push("crlSign"),e&Tr.dataEncipherment&&r.push("dataEncipherment"),e&Tr.decipherOnly&&r.push("decipherOnly"),e&Tr.digitalSignature&&r.push("digitalSignature"),e&Tr.encipherOnly&&r.push("encipherOnly"),e&Tr.keyAgreement&&r.push("keyAgreement"),e&Tr.keyCertSign&&r.push("keyCertSign"),e&Tr.keyEncipherment&&r.push("keyEncipherment"),e&Tr.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}};o(C0,"KeyUsage");var _s=C0;var E0,TU=`${G}.30`,P0=class P0{constructor(e={}){l(this,"base",new W);l(this,"minimum",0);l(this,"maximum");Object.assign(this,e)}};o(P0,"GeneralSubtree");var As=P0;f([p({type:W})],As.prototype,"base",void 0);f([p({type:m.Integer,context:0,defaultValue:0,implicit:!0})],As.prototype,"minimum",void 0);f([p({type:m.Integer,context:1,optional:!0,implicit:!0})],As.prototype,"maximum",void 0);var xs,Al=E0=(xs=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,E0.prototype)}},o(xs,"GeneralSubtrees"),xs);Al=E0=f([w({type:v.Sequence,itemType:As})],Al);var T0=class T0{constructor(e={}){l(this,"permittedSubtrees");l(this,"excludedSubtrees");Object.assign(this,e)}};o(T0,"NameConstraints");var Sl=T0;f([p({type:Al,context:0,optional:!0,implicit:!0})],Sl.prototype,"permittedSubtrees",void 0);f([p({type:Al,context:1,optional:!0,implicit:!0})],Sl.prototype,"excludedSubtrees",void 0);var BU=`${G}.36`,I0=class I0{constructor(e={}){l(this,"requireExplicitPolicy");l(this,"inhibitPolicyMapping");Object.assign(this,e)}};o(I0,"PolicyConstraints");var kl=I0;f([p({type:m.Integer,context:0,implicit:!0,optional:!0,converter:ie})],kl.prototype,"requireExplicitPolicy",void 0);f([p({type:m.Integer,context:1,implicit:!0,optional:!0,converter:ie})],kl.prototype,"inhibitPolicyMapping",void 0);var O0,VU=`${G}.33`,R0=class R0{constructor(e={}){l(this,"issuerDomainPolicy","");l(this,"subjectDomainPolicy","");Object.assign(this,e)}};o(R0,"PolicyMapping");var Fc=R0;f([p({type:m.ObjectIdentifier})],Fc.prototype,"issuerDomainPolicy",void 0);f([p({type:m.ObjectIdentifier})],Fc.prototype,"subjectDomainPolicy",void 0);var Ss,h2=O0=(Ss=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,O0.prototype)}},o(Ss,"PolicyMappings"),Ss);h2=O0=f([w({type:v.Sequence,itemType:Fc})],h2);var j0,N0=`${G}.17`,ks,Cl=j0=(ks=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,j0.prototype)}},o(ks,"SubjectAlternativeName"),ks);Cl=j0=f([w({type:v.Sequence})],Cl);var B0=class B0{constructor(e={}){l(this,"type","");l(this,"values",[]);Object.assign(this,e)}};o(B0,"Attribute");var ct=B0;f([p({type:m.ObjectIdentifier})],ct.prototype,"type",void 0);f([p({type:m.Any,repeated:"set"})],ct.prototype,"values",void 0);var D0,i$=`${G}.9`,Cs,y2=D0=(Cs=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,D0.prototype)}},o(Cs,"SubjectDirectoryAttributes"),Cs);y2=D0=f([w({type:v.Sequence,itemType:ct})],y2);var q0=`${G}.14`,M0=class M0 extends Ji{};o(M0,"SubjectKeyIdentifier");var Dt=M0;var h$=`${G}.16`,U0=class U0{constructor(e={}){l(this,"notBefore");l(this,"notAfter");Object.assign(this,e)}};o(U0,"PrivateKeyUsagePeriod");var El=U0;f([p({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],El.prototype,"notBefore",void 0);f([p({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],El.prototype,"notAfter",void 0);var zc;(function(t){t[t.keyUpdateAllowed=1]="keyUpdateAllowed",t[t.newExtensions=2]="newExtensions",t[t.pKIXCertificate=4]="pKIXCertificate"})(zc||(zc={}));var $0=class $0 extends Fr{toJSON(){let e=[],r=this.toNumber();return r&zc.pKIXCertificate&&e.push("pKIXCertificate"),r&zc.newExtensions&&e.push("newExtensions"),r&zc.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}};o($0,"EntrustInfo");var Pl=$0,V0=class V0{constructor(e={}){l(this,"entrustVers","");l(this,"entrustInfoFlags",new Pl);Object.assign(this,e)}};o(V0,"EntrustVersionInfo");var Tl=V0;f([p({type:m.GeneralString})],Tl.prototype,"entrustVers",void 0);f([p({type:Pl})],Tl.prototype,"entrustInfoFlags",void 0);var L0,k$=`${li}.11`,Es,m2=L0=(Es=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,L0.prototype)}},o(Es,"SubjectInfoAccessSyntax"),Es);m2=L0=f([w({type:v.Sequence,itemType:On})],m2);var Il=class Il{constructor(e={}){l(this,"algorithm","");l(this,"parameters");Object.assign(this,e)}isEqual(e){return e instanceof Il&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&qm(e.parameters,this.parameters)||e.parameters===this.parameters)}};o(Il,"AlgorithmIdentifier");var C=Il;f([p({type:m.ObjectIdentifier})],C.prototype,"algorithm",void 0);f([p({type:m.Any,optional:!0})],C.prototype,"parameters",void 0);var H0=class H0{constructor(e={}){l(this,"algorithm",new C);l(this,"subjectPublicKey",new ArrayBuffer(0));Object.assign(this,e)}};o(H0,"SubjectPublicKeyInfo");var ht=H0;f([p({type:C})],ht.prototype,"algorithm",void 0);f([p({type:m.BitString})],ht.prototype,"subjectPublicKey",void 0);var Ps,Me=(Ps=class{constructor(e){l(this,"utcTime");l(this,"generalTime");if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){let r=new Date(e);r.setMilliseconds(0),r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}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}},o(Ps,"Time"),Ps);f([p({type:m.UTCTime})],Me.prototype,"utcTime",void 0);f([p({type:m.GeneralizedTime})],Me.prototype,"generalTime",void 0);Me=f([w({type:v.Choice})],Me);var W0=class W0{constructor(e){l(this,"notBefore",new Me(new Date));l(this,"notAfter",new Me(new Date));e&&(this.notBefore=new Me(e.notBefore),this.notAfter=new Me(e.notAfter))}};o(W0,"Validity");var yi=W0;f([p({type:Me})],yi.prototype,"notBefore",void 0);f([p({type:Me})],yi.prototype,"notAfter",void 0);var F0,Kc=class Kc{constructor(e={}){l(this,"extnID","");l(this,"critical",Kc.CRITICAL);l(this,"extnValue",new F);Object.assign(this,e)}};o(Kc,"Extension"),l(Kc,"CRITICAL",!1);var xt=Kc;f([p({type:m.ObjectIdentifier})],xt.prototype,"extnID",void 0);f([p({type:m.Boolean,defaultValue:xt.CRITICAL})],xt.prototype,"critical",void 0);f([p({type:F})],xt.prototype,"extnValue",void 0);var Ts,pr=F0=(Ts=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,F0.prototype)}},o(Ts,"Extensions"),Ts);pr=F0=f([w({type:v.Sequence,itemType:xt})],pr);var Nn;(function(t){t[t.v1=0]="v1",t[t.v2=1]="v2",t[t.v3=2]="v3"})(Nn||(Nn={}));var z0=class z0{constructor(e={}){l(this,"version",Nn.v1);l(this,"serialNumber",new ArrayBuffer(0));l(this,"signature",new C);l(this,"issuer",new Ae);l(this,"validity",new yi);l(this,"subject",new Ae);l(this,"subjectPublicKeyInfo",new ht);l(this,"issuerUniqueID");l(this,"subjectUniqueID");l(this,"extensions");Object.assign(this,e)}};o(z0,"TBSCertificate");var yt=z0;f([p({type:m.Integer,context:0,defaultValue:Nn.v1})],yt.prototype,"version",void 0);f([p({type:m.Integer,converter:ie})],yt.prototype,"serialNumber",void 0);f([p({type:C})],yt.prototype,"signature",void 0);f([p({type:Ae})],yt.prototype,"issuer",void 0);f([p({type:yi})],yt.prototype,"validity",void 0);f([p({type:Ae})],yt.prototype,"subject",void 0);f([p({type:ht})],yt.prototype,"subjectPublicKeyInfo",void 0);f([p({type:m.BitString,context:1,implicit:!0,optional:!0})],yt.prototype,"issuerUniqueID",void 0);f([p({type:m.BitString,context:2,implicit:!0,optional:!0})],yt.prototype,"subjectUniqueID",void 0);f([p({type:pr,context:3,optional:!0})],yt.prototype,"extensions",void 0);var K0=class K0{constructor(e={}){l(this,"tbsCertificate",new yt);l(this,"tbsCertificateRaw");l(this,"signatureAlgorithm",new C);l(this,"signatureValue",new ArrayBuffer(0));Object.assign(this,e)}};o(K0,"Certificate");var Ir=K0;f([p({type:yt,raw:!0})],Ir.prototype,"tbsCertificate",void 0);f([p({type:C})],Ir.prototype,"signatureAlgorithm",void 0);f([p({type:m.BitString})],Ir.prototype,"signatureValue",void 0);var J0=class J0{constructor(e={}){l(this,"userCertificate",new ArrayBuffer(0));l(this,"revocationDate",new Me);l(this,"crlEntryExtensions");Object.assign(this,e)}};o(J0,"RevokedCertificate");var Zi=J0;f([p({type:m.Integer,converter:ie})],Zi.prototype,"userCertificate",void 0);f([p({type:Me})],Zi.prototype,"revocationDate",void 0);f([p({type:xt,optional:!0,repeated:"sequence"})],Zi.prototype,"crlEntryExtensions",void 0);var G0=class G0{constructor(e={}){l(this,"version");l(this,"signature",new C);l(this,"issuer",new Ae);l(this,"thisUpdate",new Me);l(this,"nextUpdate");l(this,"revokedCertificates");l(this,"crlExtensions");Object.assign(this,e)}};o(G0,"TBSCertList");var Gt=G0;f([p({type:m.Integer,optional:!0})],Gt.prototype,"version",void 0);f([p({type:C})],Gt.prototype,"signature",void 0);f([p({type:Ae})],Gt.prototype,"issuer",void 0);f([p({type:Me})],Gt.prototype,"thisUpdate",void 0);f([p({type:Me,optional:!0})],Gt.prototype,"nextUpdate",void 0);f([p({type:Zi,repeated:"sequence",optional:!0})],Gt.prototype,"revokedCertificates",void 0);f([p({type:xt,optional:!0,context:0,repeated:"sequence"})],Gt.prototype,"crlExtensions",void 0);var X0=class X0{constructor(e={}){l(this,"tbsCertList",new Gt);l(this,"tbsCertListRaw");l(this,"signatureAlgorithm",new C);l(this,"signature",new ArrayBuffer(0));Object.assign(this,e)}};o(X0,"CertificateList");var Qi=X0;f([p({type:Gt,raw:!0})],Qi.prototype,"tbsCertList",void 0);f([p({type:C})],Qi.prototype,"signatureAlgorithm",void 0);f([p({type:m.BitString})],Qi.prototype,"signature",void 0);var E=Ui(Ko());var Z0=class Z0{constructor(e={}){l(this,"issuer",new Ae);l(this,"serialNumber",new ArrayBuffer(0));Object.assign(this,e)}};o(Z0,"IssuerAndSerialNumber");var Or=Z0;f([p({type:Ae})],Or.prototype,"issuer",void 0);f([p({type:m.Integer,converter:ie})],Or.prototype,"serialNumber",void 0);var Is,Yi=(Is=class{constructor(e={}){l(this,"subjectKeyIdentifier");l(this,"issuerAndSerialNumber");Object.assign(this,e)}},o(Is,"SignerIdentifier"),Is);f([p({type:Dt,context:0,implicit:!0})],Yi.prototype,"subjectKeyIdentifier",void 0);f([p({type:Or})],Yi.prototype,"issuerAndSerialNumber",void 0);Yi=f([w({type:v.Choice})],Yi);var ft;(function(t){t[t.v0=0]="v0",t[t.v1=1]="v1",t[t.v2=2]="v2",t[t.v3=3]="v3",t[t.v4=4]="v4",t[t.v5=5]="v5"})(ft||(ft={}));var Os,eo=(Os=class extends C{},o(Os,"DigestAlgorithmIdentifier"),Os);eo=f([w({type:v.Sequence})],eo);var Rs,Jc=(Rs=class extends C{},o(Rs,"SignatureAlgorithmIdentifier"),Rs);Jc=f([w({type:v.Sequence})],Jc);var js,qt=(js=class extends C{},o(js,"KeyEncryptionAlgorithmIdentifier"),js);qt=f([w({type:v.Sequence})],qt);var Ns,Gc=(Ns=class extends C{},o(Ns,"ContentEncryptionAlgorithmIdentifier"),Ns);Gc=f([w({type:v.Sequence})],Gc);var Bs,v2=(Bs=class extends C{},o(Bs,"MessageAuthenticationCodeAlgorithm"),Bs);v2=f([w({type:v.Sequence})],v2);var Ds,Ol=(Ds=class extends C{},o(Ds,"KeyDerivationAlgorithmIdentifier"),Ds);Ol=f([w({type:v.Sequence})],Ol);var Q0=class Q0{constructor(e={}){l(this,"attrType","");l(this,"attrValues",[]);Object.assign(this,e)}};o(Q0,"Attribute");var Rr=Q0;f([p({type:m.ObjectIdentifier})],Rr.prototype,"attrType",void 0);f([p({type:m.Any,repeated:"set"})],Rr.prototype,"attrValues",void 0);var Y0,eg=class eg{constructor(e={}){l(this,"version",ft.v0);l(this,"sid",new Yi);l(this,"digestAlgorithm",new eo);l(this,"signedAttrs");l(this,"signedAttrsRaw");l(this,"signatureAlgorithm",new Jc);l(this,"signature",new F);l(this,"unsignedAttrs");Object.assign(this,e)}};o(eg,"SignerInfo");var Mt=eg;f([p({type:m.Integer})],Mt.prototype,"version",void 0);f([p({type:Yi})],Mt.prototype,"sid",void 0);f([p({type:eo})],Mt.prototype,"digestAlgorithm",void 0);f([p({type:Rr,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],Mt.prototype,"signedAttrs",void 0);f([p({type:Jc})],Mt.prototype,"signatureAlgorithm",void 0);f([p({type:F})],Mt.prototype,"signature",void 0);f([p({type:Rr,repeated:"set",context:1,implicit:!0,optional:!0})],Mt.prototype,"unsignedAttrs",void 0);var qs,Xc=Y0=(qs=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Y0.prototype)}},o(qs,"SignerInfos"),qs);Xc=Y0=f([w({type:v.Set,itemType:Mt})],Xc);var Ms,b2=(Ms=class extends Mt{},o(Ms,"CounterSignature"),Ms);b2=f([w({type:v.Sequence})],b2);var Us,w2=(Us=class extends Me{},o(Us,"SigningTime"),Us);w2=f([w({type:v.Choice})],w2);var tg=class tg{constructor(e={}){l(this,"acIssuer",new W);l(this,"acSerial",0);l(this,"attrs",[]);Object.assign(this,e)}};o(tg,"ACClearAttrs");var Zc=tg;f([p({type:W})],Zc.prototype,"acIssuer",void 0);f([p({type:m.Integer})],Zc.prototype,"acSerial",void 0);f([p({type:ct,repeated:"sequence"})],Zc.prototype,"attrs",void 0);var rg,$s,Qc=rg=($s=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,rg.prototype)}},o($s,"AttrSpec"),$s);Qc=rg=f([w({type:v.Sequence,itemType:m.ObjectIdentifier})],Qc);var ng=class ng{constructor(e={}){l(this,"pathLenConstraint");l(this,"permittedAttrs");l(this,"excludedAttrs");l(this,"permitUnSpecified",!0);Object.assign(this,e)}};o(ng,"AAControls");var Vs=ng;f([p({type:m.Integer,optional:!0})],Vs.prototype,"pathLenConstraint",void 0);f([p({type:Qc,implicit:!0,context:0,optional:!0})],Vs.prototype,"permittedAttrs",void 0);f([p({type:Qc,implicit:!0,context:1,optional:!0})],Vs.prototype,"excludedAttrs",void 0);f([p({type:m.Boolean,defaultValue:!0})],Vs.prototype,"permitUnSpecified",void 0);var ig=class ig{constructor(e={}){l(this,"issuer",new Ee);l(this,"serial",new ArrayBuffer(0));l(this,"issuerUID",new ArrayBuffer(0));Object.assign(this,e)}};o(ig,"IssuerSerial");var hr=ig;f([p({type:Ee})],hr.prototype,"issuer",void 0);f([p({type:m.Integer,converter:ie})],hr.prototype,"serial",void 0);f([p({type:m.BitString,optional:!0})],hr.prototype,"issuerUID",void 0);var og;(function(t){t[t.publicKey=0]="publicKey",t[t.publicKeyCert=1]="publicKeyCert",t[t.otherObjectTypes=2]="otherObjectTypes"})(og||(og={}));var sg=class sg{constructor(e={}){l(this,"digestedObjectType",og.publicKey);l(this,"otherObjectTypeID");l(this,"digestAlgorithm",new C);l(this,"objectDigest",new ArrayBuffer(0));Object.assign(this,e)}};o(sg,"ObjectDigestInfo");var yr=sg;f([p({type:m.Enumerated})],yr.prototype,"digestedObjectType",void 0);f([p({type:m.ObjectIdentifier,optional:!0})],yr.prototype,"otherObjectTypeID",void 0);f([p({type:C})],yr.prototype,"digestAlgorithm",void 0);f([p({type:m.BitString})],yr.prototype,"objectDigest",void 0);var ug=class ug{constructor(e={}){l(this,"issuerName");l(this,"baseCertificateID");l(this,"objectDigestInfo");Object.assign(this,e)}};o(ug,"V2Form");var to=ug;f([p({type:Ee,optional:!0})],to.prototype,"issuerName",void 0);f([p({type:hr,context:0,implicit:!0,optional:!0})],to.prototype,"baseCertificateID",void 0);f([p({type:yr,context:1,implicit:!0,optional:!0})],to.prototype,"objectDigestInfo",void 0);var Ls,ro=(Ls=class{constructor(e={}){l(this,"v1Form");l(this,"v2Form");Object.assign(this,e)}},o(Ls,"AttCertIssuer"),Ls);f([p({type:W,repeated:"sequence"})],ro.prototype,"v1Form",void 0);f([p({type:to,context:0,implicit:!0})],ro.prototype,"v2Form",void 0);ro=f([w({type:v.Choice})],ro);var ag=class ag{constructor(e={}){l(this,"notBeforeTime",new Date);l(this,"notAfterTime",new Date);Object.assign(this,e)}};o(ag,"AttCertValidityPeriod");var no=ag;f([p({type:m.GeneralizedTime})],no.prototype,"notBeforeTime",void 0);f([p({type:m.GeneralizedTime})],no.prototype,"notAfterTime",void 0);var cg=class cg{constructor(e={}){l(this,"baseCertificateID");l(this,"entityName");l(this,"objectDigestInfo");Object.assign(this,e)}};o(cg,"Holder");var mi=cg;f([p({type:hr,implicit:!0,context:0,optional:!0})],mi.prototype,"baseCertificateID",void 0);f([p({type:Ee,implicit:!0,context:1,optional:!0})],mi.prototype,"entityName",void 0);f([p({type:yr,implicit:!0,context:2,optional:!0})],mi.prototype,"objectDigestInfo",void 0);var fg;(function(t){t[t.v2=1]="v2"})(fg||(fg={}));var dg=class dg{constructor(e={}){l(this,"version",fg.v2);l(this,"holder",new mi);l(this,"issuer",new ro);l(this,"signature",new C);l(this,"serialNumber",new ArrayBuffer(0));l(this,"attrCertValidityPeriod",new no);l(this,"attributes",[]);l(this,"issuerUniqueID");l(this,"extensions");Object.assign(this,e)}};o(dg,"AttributeCertificateInfo");var Ut=dg;f([p({type:m.Integer})],Ut.prototype,"version",void 0);f([p({type:mi})],Ut.prototype,"holder",void 0);f([p({type:ro})],Ut.prototype,"issuer",void 0);f([p({type:C})],Ut.prototype,"signature",void 0);f([p({type:m.Integer,converter:ie})],Ut.prototype,"serialNumber",void 0);f([p({type:no})],Ut.prototype,"attrCertValidityPeriod",void 0);f([p({type:ct,repeated:"sequence"})],Ut.prototype,"attributes",void 0);f([p({type:m.BitString,optional:!0})],Ut.prototype,"issuerUniqueID",void 0);f([p({type:pr,optional:!0})],Ut.prototype,"extensions",void 0);var lg=class lg{constructor(e={}){l(this,"acinfo",new Ut);l(this,"signatureAlgorithm",new C);l(this,"signatureValue",new ArrayBuffer(0));Object.assign(this,e)}};o(lg,"AttributeCertificate");var io=lg;f([p({type:Ut})],io.prototype,"acinfo",void 0);f([p({type:C})],io.prototype,"signatureAlgorithm",void 0);f([p({type:m.BitString})],io.prototype,"signatureValue",void 0);var Yc;(function(t){t[t.unmarked=1]="unmarked",t[t.unclassified=2]="unclassified",t[t.restricted=4]="restricted",t[t.confidential=8]="confidential",t[t.secret=16]="secret",t[t.topSecret=32]="topSecret"})(Yc||(Yc={}));var pg=class pg extends Fr{};o(pg,"ClassList");var Hs=pg;var hg=class hg{constructor(e={}){l(this,"type","");l(this,"value",new ArrayBuffer(0));Object.assign(this,e)}};o(hg,"SecurityCategory");var Ws=hg;f([p({type:m.ObjectIdentifier,implicit:!0,context:0})],Ws.prototype,"type",void 0);f([p({type:m.Any,implicit:!0,context:1})],Ws.prototype,"value",void 0);var yg=class yg{constructor(e={}){l(this,"policyId","");l(this,"classList",new Hs(Yc.unclassified));l(this,"securityCategories");Object.assign(this,e)}};o(yg,"Clearance");var ef=yg;f([p({type:m.ObjectIdentifier})],ef.prototype,"policyId",void 0);f([p({type:Hs,defaultValue:new Hs(Yc.unclassified)})],ef.prototype,"classList",void 0);f([p({type:Ws,repeated:"set"})],ef.prototype,"securityCategories",void 0);var mg=class mg{constructor(e={}){l(this,"cotets");l(this,"oid");l(this,"string");Object.assign(this,e)}};o(mg,"IetfAttrSyntaxValueChoices");var Fs=mg;f([p({type:F})],Fs.prototype,"cotets",void 0);f([p({type:m.ObjectIdentifier})],Fs.prototype,"oid",void 0);f([p({type:m.Utf8String})],Fs.prototype,"string",void 0);var gg=class gg{constructor(e={}){l(this,"policyAuthority");l(this,"values",[]);Object.assign(this,e)}};o(gg,"IetfAttrSyntax");var Rl=gg;f([p({type:Ee,implicit:!0,context:0,optional:!0})],Rl.prototype,"policyAuthority",void 0);f([p({type:Fs,repeated:"sequence"})],Rl.prototype,"values",void 0);var jW=`${li}.4`,NW=`${li}.6`,BW=`${li}.10`,DW=`${G}.55`,tf=`${di}.10`,qW=`${tf}.1`,MW=`${tf}.2`,UW=`${tf}.3`,$W=`${tf}.4`,VW=`${tf}.6`,vg="2.5.4",LW=`${vg}.72`;var bg,wg=class wg{constructor(e={}){l(this,"targetCertificate",new hr);l(this,"targetName");l(this,"certDigestInfo");Object.assign(this,e)}};o(wg,"TargetCert");var Js=wg;f([p({type:hr})],Js.prototype,"targetCertificate",void 0);f([p({type:W,optional:!0})],Js.prototype,"targetName",void 0);f([p({type:yr,optional:!0})],Js.prototype,"certDigestInfo",void 0);var zs,Gs=(zs=class{constructor(e={}){l(this,"targetName");l(this,"targetGroup");l(this,"targetCert");Object.assign(this,e)}},o(zs,"Target"),zs);f([p({type:W,context:0,implicit:!0})],Gs.prototype,"targetName",void 0);f([p({type:W,context:1,implicit:!0})],Gs.prototype,"targetGroup",void 0);f([p({type:Js,context:2,implicit:!0})],Gs.prototype,"targetCert",void 0);Gs=f([w({type:v.Choice})],Gs);var Ks,jl=bg=(Ks=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,bg.prototype)}},o(Ks,"Targets"),Ks);jl=bg=f([w({type:v.Sequence,itemType:Gs})],jl);var _g,Xs,_2=_g=(Xs=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,_g.prototype)}},o(Xs,"ProxyInfo"),Xs);_2=_g=f([w({type:v.Sequence,itemType:jl})],_2);var xg=class xg{constructor(e={}){l(this,"roleAuthority");l(this,"roleName");Object.assign(this,e)}};o(xg,"RoleSyntax");var Nl=xg;f([p({type:Ee,implicit:!0,context:0,optional:!0})],Nl.prototype,"roleAuthority",void 0);f([p({type:W,implicit:!0,context:1})],Nl.prototype,"roleName",void 0);var Ag=class Ag{constructor(e={}){l(this,"service",new W);l(this,"ident",new W);l(this,"authInfo");Object.assign(this,e)}};o(Ag,"SvceAuthInfo");var rf=Ag;f([p({type:W})],rf.prototype,"service",void 0);f([p({type:W})],rf.prototype,"ident",void 0);f([p({type:F,optional:!0})],rf.prototype,"authInfo",void 0);var Sg,kg=class kg{constructor(e={}){l(this,"otherCertFormat","");l(this,"otherCert",new ArrayBuffer(0));Object.assign(this,e)}};o(kg,"OtherCertificateFormat");var nf=kg;f([p({type:m.ObjectIdentifier})],nf.prototype,"otherCertFormat",void 0);f([p({type:m.Any})],nf.prototype,"otherCert",void 0);var Zs,oo=(Zs=class{constructor(e={}){l(this,"certificate");l(this,"v2AttrCert");l(this,"other");Object.assign(this,e)}},o(Zs,"CertificateChoices"),Zs);f([p({type:Ir})],oo.prototype,"certificate",void 0);f([p({type:io,context:2,implicit:!0})],oo.prototype,"v2AttrCert",void 0);f([p({type:nf,context:3,implicit:!0})],oo.prototype,"other",void 0);oo=f([w({type:v.Choice})],oo);var Qs,so=Sg=(Qs=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Sg.prototype)}},o(Qs,"CertificateSet"),Qs);so=Sg=f([w({type:v.Set,itemType:oo})],so);var Cg=class Cg{constructor(e={}){l(this,"contentType","");l(this,"content",new ArrayBuffer(0));Object.assign(this,e)}};o(Cg,"ContentInfo");var mr=Cg;f([p({type:m.ObjectIdentifier})],mr.prototype,"contentType",void 0);f([p({type:m.Any,context:0})],mr.prototype,"content",void 0);var Ys,eu=(Ys=class{constructor(e={}){l(this,"single");l(this,"any");Object.assign(this,e)}},o(Ys,"EncapsulatedContent"),Ys);f([p({type:F})],eu.prototype,"single",void 0);f([p({type:m.Any})],eu.prototype,"any",void 0);eu=f([w({type:v.Choice})],eu);var Eg=class Eg{constructor(e={}){l(this,"eContentType","");l(this,"eContent");Object.assign(this,e)}};o(Eg,"EncapsulatedContentInfo");var uo=Eg;f([p({type:m.ObjectIdentifier})],uo.prototype,"eContentType",void 0);f([p({type:eu,context:0,optional:!0})],uo.prototype,"eContent",void 0);var tu,of=(tu=class{constructor(e={}){l(this,"value");l(this,"constructedValue");Object.assign(this,e)}},o(tu,"EncryptedContent"),tu);f([p({type:F,context:0,implicit:!0,optional:!0})],of.prototype,"value",void 0);f([p({type:F,converter:K_,context:0,implicit:!0,optional:!0,repeated:"sequence"})],of.prototype,"constructedValue",void 0);of=f([w({type:v.Choice})],of);var Pg=class Pg{constructor(e={}){l(this,"contentType","");l(this,"contentEncryptionAlgorithm",new Gc);l(this,"encryptedContent");Object.assign(this,e)}};o(Pg,"EncryptedContentInfo");var gi=Pg;f([p({type:m.ObjectIdentifier})],gi.prototype,"contentType",void 0);f([p({type:Gc})],gi.prototype,"contentEncryptionAlgorithm",void 0);f([p({type:of,optional:!0})],gi.prototype,"encryptedContent",void 0);var Tg=class Tg{constructor(e={}){l(this,"keyAttrId","");l(this,"keyAttr");Object.assign(this,e)}};o(Tg,"OtherKeyAttribute");var vi=Tg;f([p({type:m.ObjectIdentifier})],vi.prototype,"keyAttrId",void 0);f([p({type:m.Any,optional:!0})],vi.prototype,"keyAttr",void 0);var Ig,Og=class Og{constructor(e={}){l(this,"subjectKeyIdentifier",new Dt);l(this,"date");l(this,"other");Object.assign(this,e)}};o(Og,"RecipientKeyIdentifier");var ou=Og;f([p({type:Dt})],ou.prototype,"subjectKeyIdentifier",void 0);f([p({type:m.GeneralizedTime,optional:!0})],ou.prototype,"date",void 0);f([p({type:vi,optional:!0})],ou.prototype,"other",void 0);var ru,su=(ru=class{constructor(e={}){l(this,"rKeyId");l(this,"issuerAndSerialNumber");Object.assign(this,e)}},o(ru,"KeyAgreeRecipientIdentifier"),ru);f([p({type:ou,context:0,implicit:!0,optional:!0})],su.prototype,"rKeyId",void 0);f([p({type:Or,optional:!0})],su.prototype,"issuerAndSerialNumber",void 0);su=f([w({type:v.Choice})],su);var Rg=class Rg{constructor(e={}){l(this,"rid",new su);l(this,"encryptedKey",new F);Object.assign(this,e)}};o(Rg,"RecipientEncryptedKey");var sf=Rg;f([p({type:su})],sf.prototype,"rid",void 0);f([p({type:F})],sf.prototype,"encryptedKey",void 0);var nu,Bl=Ig=(nu=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Ig.prototype)}},o(nu,"RecipientEncryptedKeys"),nu);Bl=Ig=f([w({type:v.Sequence,itemType:sf})],Bl);var jg=class jg{constructor(e={}){l(this,"algorithm",new C);l(this,"publicKey",new ArrayBuffer(0));Object.assign(this,e)}};o(jg,"OriginatorPublicKey");var uf=jg;f([p({type:C})],uf.prototype,"algorithm",void 0);f([p({type:m.BitString})],uf.prototype,"publicKey",void 0);var iu,ao=(iu=class{constructor(e={}){l(this,"subjectKeyIdentifier");l(this,"originatorKey");l(this,"issuerAndSerialNumber");Object.assign(this,e)}},o(iu,"OriginatorIdentifierOrKey"),iu);f([p({type:Dt,context:0,implicit:!0,optional:!0})],ao.prototype,"subjectKeyIdentifier",void 0);f([p({type:uf,context:1,implicit:!0,optional:!0})],ao.prototype,"originatorKey",void 0);f([p({type:Or,optional:!0})],ao.prototype,"issuerAndSerialNumber",void 0);ao=f([w({type:v.Choice})],ao);var Ng=class Ng{constructor(e={}){l(this,"version",ft.v3);l(this,"originator",new ao);l(this,"ukm");l(this,"keyEncryptionAlgorithm",new qt);l(this,"recipientEncryptedKeys",new Bl);Object.assign(this,e)}};o(Ng,"KeyAgreeRecipientInfo");var Bn=Ng;f([p({type:m.Integer})],Bn.prototype,"version",void 0);f([p({type:ao,context:0})],Bn.prototype,"originator",void 0);f([p({type:F,context:1,optional:!0})],Bn.prototype,"ukm",void 0);f([p({type:qt})],Bn.prototype,"keyEncryptionAlgorithm",void 0);f([p({type:Bl})],Bn.prototype,"recipientEncryptedKeys",void 0);var uu,au=(uu=class{constructor(e={}){l(this,"subjectKeyIdentifier");l(this,"issuerAndSerialNumber");Object.assign(this,e)}},o(uu,"RecipientIdentifier"),uu);f([p({type:Dt,context:0,implicit:!0})],au.prototype,"subjectKeyIdentifier",void 0);f([p({type:Or})],au.prototype,"issuerAndSerialNumber",void 0);au=f([w({type:v.Choice})],au);var Bg=class Bg{constructor(e={}){l(this,"version",ft.v0);l(this,"rid",new au);l(this,"keyEncryptionAlgorithm",new qt);l(this,"encryptedKey",new F);Object.assign(this,e)}};o(Bg,"KeyTransRecipientInfo");var bi=Bg;f([p({type:m.Integer})],bi.prototype,"version",void 0);f([p({type:au})],bi.prototype,"rid",void 0);f([p({type:qt})],bi.prototype,"keyEncryptionAlgorithm",void 0);f([p({type:F})],bi.prototype,"encryptedKey",void 0);var Dg=class Dg{constructor(e={}){l(this,"keyIdentifier",new F);l(this,"date");l(this,"other");Object.assign(this,e)}};o(Dg,"KEKIdentifier");var co=Dg;f([p({type:F})],co.prototype,"keyIdentifier",void 0);f([p({type:m.GeneralizedTime,optional:!0})],co.prototype,"date",void 0);f([p({type:vi,optional:!0})],co.prototype,"other",void 0);var qg=class qg{constructor(e={}){l(this,"version",ft.v4);l(this,"kekid",new co);l(this,"keyEncryptionAlgorithm",new qt);l(this,"encryptedKey",new F);Object.assign(this,e)}};o(qg,"KEKRecipientInfo");var wi=qg;f([p({type:m.Integer})],wi.prototype,"version",void 0);f([p({type:co})],wi.prototype,"kekid",void 0);f([p({type:qt})],wi.prototype,"keyEncryptionAlgorithm",void 0);f([p({type:F})],wi.prototype,"encryptedKey",void 0);var Mg=class Mg{constructor(e={}){l(this,"version",ft.v0);l(this,"keyDerivationAlgorithm");l(this,"keyEncryptionAlgorithm",new qt);l(this,"encryptedKey",new F);Object.assign(this,e)}};o(Mg,"PasswordRecipientInfo");var _i=Mg;f([p({type:m.Integer})],_i.prototype,"version",void 0);f([p({type:Ol,context:0,optional:!0})],_i.prototype,"keyDerivationAlgorithm",void 0);f([p({type:qt})],_i.prototype,"keyEncryptionAlgorithm",void 0);f([p({type:F})],_i.prototype,"encryptedKey",void 0);var Ug=class Ug{constructor(e={}){l(this,"oriType","");l(this,"oriValue",new ArrayBuffer(0));Object.assign(this,e)}};o(Ug,"OtherRecipientInfo");var af=Ug;f([p({type:m.ObjectIdentifier})],af.prototype,"oriType",void 0);f([p({type:m.Any})],af.prototype,"oriValue",void 0);var cu,Dn=(cu=class{constructor(e={}){l(this,"ktri");l(this,"kari");l(this,"kekri");l(this,"pwri");l(this,"ori");Object.assign(this,e)}},o(cu,"RecipientInfo"),cu);f([p({type:bi,optional:!0})],Dn.prototype,"ktri",void 0);f([p({type:Bn,context:1,implicit:!0,optional:!0})],Dn.prototype,"kari",void 0);f([p({type:wi,context:2,implicit:!0,optional:!0})],Dn.prototype,"kekri",void 0);f([p({type:_i,context:3,implicit:!0,optional:!0})],Dn.prototype,"pwri",void 0);f([p({type:af,context:4,implicit:!0,optional:!0})],Dn.prototype,"ori",void 0);Dn=f([w({type:v.Choice})],Dn);var $g,fu,cf=$g=(fu=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,$g.prototype)}},o(fu,"RecipientInfos"),fu);cf=$g=f([w({type:v.Set,itemType:Dn})],cf);var Vg,x2=`${di}.16`,Hz=`${x2}.2`,Wz=`${x2}.4`,Lg=class Lg{constructor(e={}){l(this,"otherRevInfoFormat","");l(this,"otherRevInfo",new ArrayBuffer(0));Object.assign(this,e)}};o(Lg,"OtherRevocationInfoFormat");var pu=Lg;f([p({type:m.ObjectIdentifier})],pu.prototype,"otherRevInfoFormat",void 0);f([p({type:m.Any})],pu.prototype,"otherRevInfo",void 0);var du,Dl=(du=class{constructor(e={}){l(this,"other",new pu);Object.assign(this,e)}},o(du,"RevocationInfoChoice"),du);f([p({type:pu,context:1,implicit:!0})],Dl.prototype,"other",void 0);Dl=f([w({type:v.Choice})],Dl);var lu,hu=Vg=(lu=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Vg.prototype)}},o(lu,"RevocationInfoChoices"),lu);hu=Vg=f([w({type:v.Set,itemType:Dl})],hu);var Hg=class Hg{constructor(e={}){l(this,"certs");l(this,"crls");Object.assign(this,e)}};o(Hg,"OriginatorInfo");var yu=Hg;f([p({type:so,context:0,implicit:!0,optional:!0})],yu.prototype,"certs",void 0);f([p({type:hu,context:1,implicit:!0,optional:!0})],yu.prototype,"crls",void 0);var Wg,mu,Fg=Wg=(mu=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Wg.prototype)}},o(mu,"UnprotectedAttributes"),mu);Fg=Wg=f([w({type:v.Set,itemType:Rr})],Fg);var zg=class zg{constructor(e={}){l(this,"version",ft.v0);l(this,"originatorInfo");l(this,"recipientInfos",new cf);l(this,"encryptedContentInfo",new gi);l(this,"unprotectedAttrs");Object.assign(this,e)}};o(zg,"EnvelopedData");var fo=zg;f([p({type:m.Integer})],fo.prototype,"version",void 0);f([p({type:yu,context:0,implicit:!0,optional:!0})],fo.prototype,"originatorInfo",void 0);f([p({type:cf})],fo.prototype,"recipientInfos",void 0);f([p({type:gi})],fo.prototype,"encryptedContentInfo",void 0);f([p({type:Fg,context:1,implicit:!0,optional:!0})],fo.prototype,"unprotectedAttrs",void 0);var A2="1.2.840.113549.1.7.2";var Kg,gu,ql=Kg=(gu=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Kg.prototype)}},o(gu,"DigestAlgorithmIdentifiers"),gu);ql=Kg=f([w({type:v.Set,itemType:eo})],ql);var Jg=class Jg{constructor(e={}){l(this,"version",ft.v0);l(this,"digestAlgorithms",new ql);l(this,"encapContentInfo",new uo);l(this,"certificates");l(this,"crls");l(this,"signerInfos",new Xc);Object.assign(this,e)}};o(Jg,"SignedData");var qn=Jg;f([p({type:m.Integer})],qn.prototype,"version",void 0);f([p({type:ql})],qn.prototype,"digestAlgorithms",void 0);f([p({type:uo})],qn.prototype,"encapContentInfo",void 0);f([p({type:so,context:0,implicit:!0,optional:!0})],qn.prototype,"certificates",void 0);f([p({type:hu,context:1,implicit:!0,optional:!0})],qn.prototype,"crls",void 0);f([p({type:Xc})],qn.prototype,"signerInfos",void 0);var lo="1.2.840.10045.2.1";var ff="1.2.840.10045.4.1",Ml="1.2.840.10045.4.3.1",df="1.2.840.10045.4.3.2",lf="1.2.840.10045.4.3.3",pf="1.2.840.10045.4.3.4";var Gg="1.2.840.10045.3.1.7";var Xg="1.3.132.0.34";var Zg="1.3.132.0.35";function hf(t){return new C({algorithm:t})}o(hf,"create");var k2=hf(ff),$K=hf(Ml),C2=hf(df),E2=hf(lf),P2=hf(pf);var vu,yf=(vu=class{constructor(e={}){l(this,"fieldType");l(this,"parameters");Object.assign(this,e)}},o(vu,"FieldID"),vu);f([p({type:m.ObjectIdentifier})],yf.prototype,"fieldType",void 0);f([p({type:m.Any})],yf.prototype,"parameters",void 0);yf=f([w({type:v.Sequence})],yf);var ev=class ev extends F{};o(ev,"ECPoint");var Qg=ev;var bu,_u=(bu=class{constructor(e={}){l(this,"a");l(this,"b");l(this,"seed");Object.assign(this,e)}},o(bu,"Curve"),bu);f([p({type:m.OctetString})],_u.prototype,"a",void 0);f([p({type:m.OctetString})],_u.prototype,"b",void 0);f([p({type:m.BitString,optional:!0})],_u.prototype,"seed",void 0);_u=f([w({type:v.Sequence})],_u);var Yg;(function(t){t[t.ecpVer1=1]="ecpVer1"})(Yg||(Yg={}));var wu,Jr=(wu=class{constructor(e={}){l(this,"version",Yg.ecpVer1);l(this,"fieldID");l(this,"curve");l(this,"base");l(this,"order");l(this,"cofactor");Object.assign(this,e)}},o(wu,"SpecifiedECDomain"),wu);f([p({type:m.Integer})],Jr.prototype,"version",void 0);f([p({type:yf})],Jr.prototype,"fieldID",void 0);f([p({type:_u})],Jr.prototype,"curve",void 0);f([p({type:Qg})],Jr.prototype,"base",void 0);f([p({type:m.Integer,converter:ie})],Jr.prototype,"order",void 0);f([p({type:m.Integer,optional:!0})],Jr.prototype,"cofactor",void 0);Jr=f([w({type:v.Sequence})],Jr);var xu,Gr=(xu=class{constructor(e={}){l(this,"namedCurve");l(this,"implicitCurve");l(this,"specifiedCurve");Object.assign(this,e)}},o(xu,"ECParameters"),xu);f([p({type:m.ObjectIdentifier})],Gr.prototype,"namedCurve",void 0);f([p({type:m.Null})],Gr.prototype,"implicitCurve",void 0);f([p({type:Jr})],Gr.prototype,"specifiedCurve",void 0);Gr=f([w({type:v.Choice})],Gr);var tv=class tv{constructor(e={}){l(this,"version",1);l(this,"privateKey",new F);l(this,"parameters");l(this,"publicKey");Object.assign(this,e)}};o(tv,"ECPrivateKey");var Au=tv;f([p({type:m.Integer})],Au.prototype,"version",void 0);f([p({type:F})],Au.prototype,"privateKey",void 0);f([p({type:Gr,context:0,optional:!0})],Au.prototype,"parameters",void 0);f([p({type:m.BitString,context:1,optional:!0})],Au.prototype,"publicKey",void 0);var rv=class rv{constructor(e={}){l(this,"r",new ArrayBuffer(0));l(this,"s",new ArrayBuffer(0));Object.assign(this,e)}};o(rv,"ECDSASigValue");var po=rv;f([p({type:m.Integer,converter:ie})],po.prototype,"r",void 0);f([p({type:m.Integer,converter:ie})],po.prototype,"s",void 0);var $t="1.2.840.113549.1.1",Xr=`${$t}.1`,T2=`${$t}.7`,I2=`${$t}.9`,xi=`${$t}.10`,O2=`${$t}.2`,R2=`${$t}.4`,Su=`${$t}.5`,j2=`${$t}.14`;var Ul=`${$t}.11`,ku=`${$t}.12`,Cu=`${$t}.13`,nv=`${$t}.15`,iv=`${$t}.16`,ho="1.3.14.3.2.26",$l="2.16.840.1.101.3.4.2.4",yo="2.16.840.1.101.3.4.2.1",mo="2.16.840.1.101.3.4.2.2",go="2.16.840.1.101.3.4.2.3",N2="2.16.840.1.101.3.4.2.5",B2="2.16.840.1.101.3.4.2.6",D2="1.2.840.113549.2.2",q2="1.2.840.113549.2.5",Ai=`${$t}.8`;function Ye(t){return new C({algorithm:t,parameters:null})}o(Ye,"create");var yJ=Ye(D2),mJ=Ye(q2),Mn=Ye(ho),gJ=Ye($l),vJ=Ye(yo),bJ=Ye(mo),wJ=Ye(go),_J=Ye(N2),xJ=Ye(B2),Vl=new C({algorithm:Ai,parameters:Er.serialize(Mn)}),ov=new C({algorithm:I2,parameters:Er.serialize(Xo.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))}),AJ=Ye(Xr),SJ=Ye(O2),kJ=Ye(R2),CJ=Ye(Su),EJ=Ye(nv),PJ=Ye(iv),TJ=Ye(ku),IJ=Ye(Cu),OJ=Ye(nv),RJ=Ye(iv);var sv=class sv{constructor(e={}){l(this,"hashAlgorithm",new C(Mn));l(this,"maskGenAlgorithm",new C({algorithm:Ai,parameters:Er.serialize(Mn)}));l(this,"pSourceAlgorithm",new C(ov));Object.assign(this,e)}};o(sv,"RsaEsOaepParams");var Eu=sv;f([p({type:C,context:0,defaultValue:Mn})],Eu.prototype,"hashAlgorithm",void 0);f([p({type:C,context:1,defaultValue:Vl})],Eu.prototype,"maskGenAlgorithm",void 0);f([p({type:C,context:2,defaultValue:ov})],Eu.prototype,"pSourceAlgorithm",void 0);var $J=new C({algorithm:T2,parameters:Er.serialize(new Eu)});var uv=class uv{constructor(e={}){l(this,"hashAlgorithm",new C(Mn));l(this,"maskGenAlgorithm",new C({algorithm:Ai,parameters:Er.serialize(Mn)}));l(this,"saltLength",20);l(this,"trailerField",1);Object.assign(this,e)}};o(uv,"RsaSaPssParams");var Zr=uv;f([p({type:C,context:0,defaultValue:Mn})],Zr.prototype,"hashAlgorithm",void 0);f([p({type:C,context:1,defaultValue:Vl})],Zr.prototype,"maskGenAlgorithm",void 0);f([p({type:m.Integer,context:2,defaultValue:20})],Zr.prototype,"saltLength",void 0);f([p({type:m.Integer,context:3,defaultValue:1})],Zr.prototype,"trailerField",void 0);var JJ=new C({algorithm:xi,parameters:Er.serialize(new Zr)});var av=class av{constructor(e={}){l(this,"digestAlgorithm",new C);l(this,"digest",new F);Object.assign(this,e)}};o(av,"DigestInfo");var vo=av;f([p({type:C})],vo.prototype,"digestAlgorithm",void 0);f([p({type:F})],vo.prototype,"digest",void 0);var cv,fv=class fv{constructor(e={}){l(this,"prime",new ArrayBuffer(0));l(this,"exponent",new ArrayBuffer(0));l(this,"coefficient",new ArrayBuffer(0));Object.assign(this,e)}};o(fv,"OtherPrimeInfo");var Tu=fv;f([p({type:m.Integer,converter:ie})],Tu.prototype,"prime",void 0);f([p({type:m.Integer,converter:ie})],Tu.prototype,"exponent",void 0);f([p({type:m.Integer,converter:ie})],Tu.prototype,"coefficient",void 0);var Pu,Ll=cv=(Pu=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,cv.prototype)}},o(Pu,"OtherPrimeInfos"),Pu);Ll=cv=f([w({type:v.Sequence,itemType:Tu})],Ll);var dv=class dv{constructor(e={}){l(this,"version",0);l(this,"modulus",new ArrayBuffer(0));l(this,"publicExponent",new ArrayBuffer(0));l(this,"privateExponent",new ArrayBuffer(0));l(this,"prime1",new ArrayBuffer(0));l(this,"prime2",new ArrayBuffer(0));l(this,"exponent1",new ArrayBuffer(0));l(this,"exponent2",new ArrayBuffer(0));l(this,"coefficient",new ArrayBuffer(0));l(this,"otherPrimeInfos");Object.assign(this,e)}};o(dv,"RSAPrivateKey");var gr=dv;f([p({type:m.Integer})],gr.prototype,"version",void 0);f([p({type:m.Integer,converter:ie})],gr.prototype,"modulus",void 0);f([p({type:m.Integer,converter:ie})],gr.prototype,"publicExponent",void 0);f([p({type:m.Integer,converter:ie})],gr.prototype,"privateExponent",void 0);f([p({type:m.Integer,converter:ie})],gr.prototype,"prime1",void 0);f([p({type:m.Integer,converter:ie})],gr.prototype,"prime2",void 0);f([p({type:m.Integer,converter:ie})],gr.prototype,"exponent1",void 0);f([p({type:m.Integer,converter:ie})],gr.prototype,"exponent2",void 0);f([p({type:m.Integer,converter:ie})],gr.prototype,"coefficient",void 0);f([p({type:Ll,optional:!0})],gr.prototype,"otherPrimeInfos",void 0);var lv=class lv{constructor(e={}){l(this,"modulus",new ArrayBuffer(0));l(this,"publicExponent",new ArrayBuffer(0));Object.assign(this,e)}};o(lv,"RSAPublicKey");var Iu=lv;f([p({type:m.Integer,converter:ie})],Iu.prototype,"modulus",void 0);f([p({type:m.Integer,converter:ie})],Iu.prototype,"publicExponent",void 0);var pv;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(pv||(pv={}));var dt=pv;var hv=o(function(t,e){return hv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},hv(t,e)},"extendStatics");function mf(t,e){hv(t,e);function r(){this.constructor=t}o(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}o(mf,"__extends");function M2(t,e,r,n){function i(s){return s instanceof r?s:new r(function(u){u(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,u){function a(h){try{d(n.next(h))}catch(y){u(y)}}o(a,"fulfilled");function c(h){try{d(n.throw(h))}catch(y){u(y)}}o(c,"rejected");function d(h){h.done?s(h.value):i(h.value).then(a,c)}o(d,"step"),d((n=n.apply(t,e||[])).next())})}o(M2,"__awaiter");function U2(t,e){var r={label:0,sent:o(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,i,s,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(d){return function(h){return c([d,h])}}function c(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=d[0]&2?i.return:d[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,d[1])).done)return s;switch(i=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(h){d=[6,h],i=0}finally{n=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}o(U2,"__generator");function gf(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:o(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}o(gf,"__values");function Ou(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],u;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){u={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}o(Ou,"__read");function Qr(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ou(arguments[e]));return t}o(Qr,"__spread");var IC="injectionTokens";function yv(t){var e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(IC,t)||{};return Object.keys(r).forEach(function(n){e[+n]=r[n]}),e}o(yv,"getParamInfo");function vf(t){return!!t.useClass}o(vf,"isClassProvider");function Ru(t){return!!t.useFactory}o(Ru,"isFactoryProvider");var Hl=(function(){function t(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return o(t,"DelayedConstructor"),t.prototype.createProxy=function(e){var r=this,n={},i=!1,s,u=o(function(){return i||(s=e(r.wrap()),i=!0),s},"delayedObject");return new Proxy(n,this.createHandler(u))},t.prototype.createHandler=function(e){var r={},n=o(function(i){r[i]=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];s[0]=e();var a=Reflect[i];return a.apply(void 0,Qr(s))}},"install");return this.reflectMethods.forEach(n),r},t})();function Si(t){return typeof t=="string"||typeof t=="symbol"}o(Si,"isNormalToken");function mv(t){return typeof t=="object"&&"token"in t&&"multiple"in t}o(mv,"isTokenDescriptor");function Wl(t){return typeof t=="object"&&"token"in t&&"transform"in t}o(Wl,"isTransformDescriptor");function $2(t){return typeof t=="function"||t instanceof Hl}o($2,"isConstructorToken");function bo(t){return!!t.useToken}o(bo,"isTokenProvider");function wo(t){return t.useValue!=null}o(wo,"isValueProvider");function V2(t){return vf(t)||wo(t)||bo(t)||Ru(t)}o(V2,"isProvider");var OC=(function(){function t(){this._registryMap=new Map}return o(t,"RegistryBase"),t.prototype.entries=function(){return this._registryMap.entries()},t.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},t.prototype.get=function(e){this.ensure(e);var r=this._registryMap.get(e);return r[r.length-1]||null},t.prototype.set=function(e,r){this.ensure(e),this._registryMap.get(e).push(r)},t.prototype.setAll=function(e,r){this._registryMap.set(e,r)},t.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},t.prototype.clear=function(){this._registryMap.clear()},t.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},t})(),bf=OC;var RC=(function(t){mf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return o(e,"Registry"),e})(bf),L2=RC;var jC=(function(){function t(){this.scopedResolutions=new Map}return o(t,"ResolutionContext"),t})(),wf=jC;function NC(t,e){if(t===null)return"at position #"+e;var r=t.split(",")[e].trim();return'"'+r+'" at position #'+e}o(NC,"formatDependency");function BC(t,e,r){return r===void 0&&(r=" "),Qr([t],e.message.split(`
|
|
15
20
|
`).map(function(n){return r+n})).join(`
|
|
16
|
-
`)}o(sk,"composeErrorMessage");function Ug(t,e,r){var n=mu(t.toString().match(/constructor\(([\w, ]+)\)/)||[],2),i=n[1],s=i===void 0?null:i,u=ok(s,e);return sk("Cannot inject the dependency "+u+' of "'+t.name+'" constructor. Reason:',r)}o(Ug,"formatErrorCtor");function o2(t){if(typeof t.dispose!="function")return!1;var e=t.dispose;return!(e.length>0)}o(o2,"isDisposable");var uk=(function(t){Zc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return o(e,"PreResolutionInterceptors"),e})(ef);var ak=(function(t){Zc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return o(e,"PostResolutionInterceptors"),e})(ef);var ck=(function(){function t(){this.preResolution=new uk,this.postResolution=new ak}return o(t,"Interceptors"),t})(),s2=ck;var $g=new Map,fk=(function(){function t(e){this.parent=e,this._registry=new i2,this.interceptors=new s2,this.disposed=!1,this.disposables=new Set}return o(t,"InternalDependencyContainer"),t.prototype.register=function(e,r,n){n===void 0&&(n={lifecycle:tt.Transient}),this.ensureNotDisposed();var i;if(n2(r)?i=r:i={useClass:r},oo(i))for(var s=[e],u=i;u!=null;){var a=u.useToken;if(s.includes(a))throw new Error("Token registration cycle detected! "+Mr(s,[a]).join(" -> "));s.push(a);var c=this._registry.get(a);c&&oo(c.provider)?u=c.provider:u=null}if((n.lifecycle===tt.Singleton||n.lifecycle==tt.ContainerScoped||n.lifecycle==tt.ResolutionScoped)&&(so(i)||gu(i)))throw new Error('Cannot use lifecycle "'+tt[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:i,options:n}),this},t.prototype.registerType=function(e,r){return this.ensureNotDisposed(),Qn(r)?this.register(e,{useToken:r}):this.register(e,{useClass:r})},t.prototype.registerInstance=function(e,r){return this.ensureNotDisposed(),this.register(e,{useValue:r})},t.prototype.registerSingleton=function(e,r){if(this.ensureNotDisposed(),Qn(e)){if(Qn(r))return this.register(e,{useToken:r},{lifecycle:tt.Singleton});if(r)return this.register(e,{useClass:r},{lifecycle:tt.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=e;return r&&!Qn(r)&&(n=r),this.register(e,{useClass:n},{lifecycle:tt.Singleton})},t.prototype.resolve=function(e,r,n){r===void 0&&(r=new tf),n===void 0&&(n=!1),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&Qn(e)){if(n)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),i){var s=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(r2(e)){var s=this.construct(e,r);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},t.prototype.executePreResolutionInterceptor=function(e,r){var n,i;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var u=Qc(this.interceptors.preResolution.getAll(e)),a=u.next();!a.done;a=u.next()){var c=a.value;c.options.frequency!="Once"&&s.push(c),c.callback(e,r)}}catch(d){n={error:d}}finally{try{a&&!a.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(e,s)}},t.prototype.executePostResolutionInterceptor=function(e,r,n){var i,s;if(this.interceptors.postResolution.has(e)){var u=[];try{for(var a=Qc(this.interceptors.postResolution.getAll(e)),c=a.next();!c.done;c=a.next()){var d=c.value;d.options.frequency!="Once"&&u.push(d),d.callback(e,r,n)}}catch(p){i={error:p}}finally{try{c&&!c.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}this.interceptors.postResolution.setAll(e,u)}},t.prototype.resolveRegistration=function(e,r){if(this.ensureNotDisposed(),e.options.lifecycle===tt.ResolutionScoped&&r.scopedResolutions.has(e))return r.scopedResolutions.get(e);var n=e.options.lifecycle===tt.Singleton,i=e.options.lifecycle===tt.ContainerScoped,s=n||i,u;return so(e.provider)?u=e.provider.useValue:oo(e.provider)?u=s?e.instance||(e.instance=this.resolve(e.provider.useToken,r)):this.resolve(e.provider.useToken,r):Yc(e.provider)?u=s?e.instance||(e.instance=this.construct(e.provider.useClass,r)):this.construct(e.provider.useClass,r):gu(e.provider)?u=e.provider.useFactory(this):u=this.construct(e.provider,r),e.options.lifecycle===tt.ResolutionScoped&&r.scopedResolutions.set(e,u),u},t.prototype.resolveAll=function(e,r,n){var i=this;r===void 0&&(r=new tf),n===void 0&&(n=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&Qn(e)){if(n)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var u=s.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(e,u,"All"),u}var a=[this.construct(e,r)];return this.executePostResolutionInterceptor(e,a,"All"),a},t.prototype.isRegistered=function(e,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(e)||r&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},t.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},t.prototype.clearInstances=function(){var e,r;this.ensureNotDisposed();try{for(var n=Qc(this._registry.entries()),i=n.next();!i.done;i=n.next()){var s=mu(i.value,2),u=s[0],a=s[1];this._registry.setAll(u,a.filter(function(c){return!so(c.provider)}).map(function(c){return c.instance=void 0,c}))}}catch(c){e={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t.prototype.createChildContainer=function(){var e,r;this.ensureNotDisposed();var n=new t(this);try{for(var i=Qc(this._registry.entries()),s=i.next();!s.done;s=i.next()){var u=mu(s.value,2),a=u[0],c=u[1];c.some(function(d){var p=d.options;return p.lifecycle===tt.ContainerScoped})&&n._registry.setAll(a,c.map(function(d){return d.options.lifecycle===tt.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){e={error:d}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},t.prototype.beforeResolution=function(e,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:r,options:n})},t.prototype.afterResolution=function(e,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:r,options:n})},t.prototype.dispose=function(){return e2(this,void 0,void 0,function(){var e;return t2(this,function(r){switch(r.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 r.sent(),[2]}})})},t.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},t.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},t.prototype.construct=function(e,r){var n=this;if(e instanceof xl)return e.createProxy(function(s){return n.resolve(s,r)});var i=(function(){var s=$g.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var u=s.map(n.resolveParams(r,e));return new(e.bind.apply(e,Mr([void 0],u)))})();return o2(i)&&this.disposables.add(i),i},t.prototype.resolveParams=function(e,r){var n=this;return function(i,s){var u,a,c;try{return Mg(i)?Al(i)?i.multiple?(u=n.resolve(i.transform)).transform.apply(u,Mr([n.resolveAll(i.token,new tf,i.isOptional)],i.transformArgs)):(a=n.resolve(i.transform)).transform.apply(a,Mr([n.resolve(i.token,e,i.isOptional)],i.transformArgs)):i.multiple?n.resolveAll(i.token,new tf,i.isOptional):n.resolve(i.token,e,i.isOptional):Al(i)?(c=n.resolve(i.transform,e)).transform.apply(c,Mr([n.resolve(i.token,e)],i.transformArgs)):n.resolve(i,e)}catch(d){throw new Error(Ug(r,s,d))}}},t.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},t})(),ke=new fk;function dk(t){return function(e){$g.set(e,qg(e)),t&&t.token&&(Array.isArray(t.token)?t.token.forEach(function(r){ke.register(r,e)}):ke.register(t.token,e))}}o(dk,"injectable");var Yn=dk;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 Hg,Lg=class Lg{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}};o(Lg,"PKCS12Attribute");var uo=Lg;f([l({type:h.ObjectIdentifier})],uo.prototype,"attrId",void 0);f([l({type:h.Any,repeated:"set"})],uo.prototype,"attrValues",void 0);var vu,u2=Hg=(vu=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Hg.prototype)}},o(vu,"PKCS12AttrSet"),vu);u2=Hg=f([b({type:g.Sequence,itemType:uo})],u2);var Wg,bu,a2=Wg=(bu=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Wg.prototype)}},o(bu,"AuthenticatedSafe"),bu);a2=Wg=f([b({type:g.Sequence,itemType:er})],a2);var lk="1.2.840.113549",pk=`${lk}.1`,c2=`${pk}.12`,wu=`${c2}.1`,Iz=`${wu}.1`,Oz=`${wu}.2`,Rz=`${wu}.3`,jz=`${wu}.4`,Nz=`${wu}.5`,Bz=`${wu}.6`,ao=`${c2}.10.1`;var Mz=`${ao}.1`,Uz=`${ao}.2`,$z=`${ao}.3`,Vz=`${ao}.4`,Hz=`${ao}.5`,Lz=`${ao}.6`,Sl="1.2.840.113549.1.9";var Fg=class Fg{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}};o(Fg,"CertBag");var kl=Fg;f([l({type:h.ObjectIdentifier})],kl.prototype,"certId",void 0);f([l({type:h.Any,context:0})],kl.prototype,"certValue",void 0);var f2=`${Sl}.22`,zz=`${f2}.1`,Gz=`${f2}.2`;var Kg=class Kg{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}};o(Kg,"CRLBag");var Cl=Kg;f([l({type:h.ObjectIdentifier})],Cl.prototype,"crlId",void 0);f([l({type:h.Any,context:0})],Cl.prototype,"crltValue",void 0);var hk=`${Sl}.23`,tG=`${hk}.1`;var Jg=class Jg extends V{};o(Jg,"EncryptedData");var El=Jg,zg=class zg{constructor(e={}){this.encryptionAlgorithm=new k,this.encryptedData=new El,Object.assign(this,e)}};o(zg,"EncryptedPrivateKeyInfo");var ei=zg;f([l({type:k})],ei.prototype,"encryptionAlgorithm",void 0);f([l({type:El})],ei.prototype,"encryptedData",void 0);var Gg,Xg;(function(t){t[t.v1=0]="v1"})(Xg||(Xg={}));var Qg=class Qg extends V{};o(Qg,"PrivateKey");var Pl=Qg,_u,Zg=Gg=(_u=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,Gg.prototype)}},o(_u,"Attributes"),_u);Zg=Gg=f([b({type:g.Sequence,itemType:Ye})],Zg);var Yg=class Yg{constructor(e={}){this.version=Xg.v1,this.privateKeyAlgorithm=new k,this.privateKey=new Pl,Object.assign(this,e)}};o(Yg,"PrivateKeyInfo");var ti=Yg;f([l({type:h.Integer})],ti.prototype,"version",void 0);f([l({type:k})],ti.prototype,"privateKeyAlgorithm",void 0);f([l({type:Pl})],ti.prototype,"privateKey",void 0);f([l({type:Zg,implicit:!0,context:0,optional:!0})],ti.prototype,"attributes",void 0);var xu,d2=(xu=class extends ti{},o(xu,"KeyBag"),xu);d2=f([b({type:g.Sequence})],d2);var Au,l2=(Au=class extends ei{},o(Au,"PKCS8ShroudedKeyBag"),Au);l2=f([b({type:g.Sequence})],l2);var ev=class ev{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}};o(ev,"SecretBag");var Tl=ev;f([l({type:h.ObjectIdentifier})],Tl.prototype,"secretTypeId",void 0);f([l({type:h.Any,context:0})],Tl.prototype,"secretValue",void 0);var tv=class tv{constructor(e={}){this.mac=new io,this.macSalt=new V,this.iterations=1,Object.assign(this,e)}};o(tv,"MacData");var ri=tv;f([l({type:io})],ri.prototype,"mac",void 0);f([l({type:V})],ri.prototype,"macSalt",void 0);f([l({type:h.Integer,defaultValue:1})],ri.prototype,"iterations",void 0);var rv=class rv{constructor(e={}){this.version=3,this.authSafe=new er,this.macData=new ri,Object.assign(this,e)}};o(rv,"PFX");var co=rv;f([l({type:h.Integer})],co.prototype,"version",void 0);f([l({type:er})],co.prototype,"authSafe",void 0);f([l({type:ri,optional:!0})],co.prototype,"macData",void 0);var nv,iv=class iv{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}};o(iv,"SafeBag");var ku=iv;f([l({type:h.ObjectIdentifier})],ku.prototype,"bagId",void 0);f([l({type:h.Any,context:0})],ku.prototype,"bagValue",void 0);f([l({type:uo,repeated:"set",optional:!0})],ku.prototype,"bagAttributes",void 0);var Su,p2=nv=(Su=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,nv.prototype)}},o(Su,"SafeContents"),Su);p2=nv=f([b({type:g.Sequence,itemType:ku})],p2);var ov,sv,uv,Re="1.2.840.113549.1.9",aX=`${Re}.0`,E2=`${Re}.24`,nf=`${Re}.25`,P2=`${Re}.26`,T2=`${Re}.27`,cX=`${E2}.1`,fX=`${E2}.2`,dX=`${Re}.1`,lX=`${Re}.2`,pX=`${Re}.3`,hX=`${Re}.4`,yX=`${Re}.5`,mX=`${Re}.6`,yv=`${Re}.7`,gX=`${Re}.8`,vX=`${Re}.9`,bX=`${Re}.13`,of=`${Re}.14`,wX=`${Re}.15`,_X=`${Re}.20`,xX=`${Re}.21`;var AX=`${nf}.1`,SX=`${nf}.2`,kX=`${nf}.3`,CX=`${nf}.4`,EX=`${nf}.5`,sf="1.3.6.1.5.5.7.9",PX=`${sf}.1`,TX=`${sf}.2`,IX=`${sf}.3`,OX=`${sf}.4`,RX=`${sf}.5`,jX=`${P2}.1`,NX=`${P2}.2`,BX=`${T2}.1`,DX=`${T2}.2`,qX=`${Re}.16`,MX=`${Re}.22`,UX=`${Re}.23`,$X=`${$m}.65`,Cu,Il=(Cu=class extends He{constructor(e={}){super(e)}toString(){return{}.toString(),this.ia5String||super.toString()}},o(Cu,"PKCS9String"),Cu);f([l({type:h.IA5String})],Il.prototype,"ia5String",void 0);Il=f([b({type:g.Choice})],Il);var Eu,h2=(Eu=class extends er{},o(Eu,"Pkcs7PDU"),Eu);h2=f([b({type:g.Sequence})],h2);var Pu,y2=(Pu=class extends co{},o(Pu,"UserPKCS12"),Pu);y2=f([b({type:g.Sequence})],y2);var Tu,m2=(Tu=class extends ei{},o(Tu,"EncryptedPrivateKeyInfo"),Tu);m2=f([b({type:g.Sequence})],m2);var Iu,av=(Iu=class{constructor(e=""){this.value=e}toString(){return this.value}},o(Iu,"EmailAddress"),Iu);f([l({type:h.IA5String})],av.prototype,"value",void 0);av=f([b({type:g.Choice})],av);var Ou,g2=(Ou=class extends Il{},o(Ou,"UnstructuredName"),Ou);g2=f([b({type:g.Choice})],g2);var Ru,v2=(Ru=class extends He{},o(Ru,"UnstructuredAddress"),Ru);v2=f([b({type:g.Choice})],v2);var ju,cv=(ju=class{constructor(e=new Date){this.value=e}},o(ju,"DateOfBirth"),ju);f([l({type:h.GeneralizedTime})],cv.prototype,"value",void 0);cv=f([b({type:g.Choice})],cv);var Nu,b2=(Nu=class extends He{},o(Nu,"PlaceOfBirth"),Nu);b2=f([b({type:g.Choice})],b2);var Bu,fv=(Bu=class{constructor(e="M"){this.value=e}toString(){return this.value}},o(Bu,"Gender"),Bu);f([l({type:h.PrintableString})],fv.prototype,"value",void 0);fv=f([b({type:g.Choice})],fv);var Du,Ol=(Du=class{constructor(e=""){this.value=e}toString(){return this.value}},o(Du,"CountryOfCitizenship"),Du);f([l({type:h.PrintableString})],Ol.prototype,"value",void 0);Ol=f([b({type:g.Choice})],Ol);var qu,w2=(qu=class extends Ol{},o(qu,"CountryOfResidence"),qu);w2=f([b({type:g.Choice})],w2);var Mu,_2=(Mu=class extends He{},o(Mu,"Pseudonym"),Mu);_2=f([b({type:g.Choice})],_2);var Uu,dv=(Uu=class{constructor(e=""){this.value=e}toString(){return this.value}},o(Uu,"ContentType"),Uu);f([l({type:h.ObjectIdentifier})],dv.prototype,"value",void 0);dv=f([b({type:g.Choice})],dv);var $u,x2=($u=class extends Oe{},o($u,"SigningTime"),$u);x2=f([b({type:g.Choice})],x2);var Vu,lv=(Vu=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}},o(Vu,"SequenceNumber"),Vu);f([l({type:h.Integer})],lv.prototype,"value",void 0);lv=f([b({type:g.Choice})],lv);var Hu,A2=(Hu=class extends Pt{},o(Hu,"CounterSignature"),Hu);A2=f([b({type:g.Sequence})],A2);var Lu,rf=(Lu=class extends He{},o(Lu,"ChallengePassword"),Lu);rf=f([b({type:g.Choice})],rf);var Wu,S2=ov=(Wu=class extends Zt{constructor(e){super(e),Object.setPrototypeOf(this,ov.prototype)}},o(Wu,"ExtensionRequest"),Wu);S2=ov=f([b({type:g.Sequence})],S2);var Fu,k2=sv=(Fu=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,sv.prototype)}},o(Fu,"ExtendedCertificateAttributes"),Fu);k2=sv=f([b({type:g.Set,itemType:gr})],k2);var Ku,pv=(Ku=class{constructor(e=""){this.value=e}toString(){return this.value}},o(Ku,"FriendlyName"),Ku);f([l({type:h.BmpString})],pv.prototype,"value",void 0);pv=f([b({type:g.Choice})],pv);var Ju,hv=(Ju=class extends k{},o(Ju,"SMIMECapability"),Ju);hv=f([b({type:g.Sequence})],hv);var zu,C2=uv=(zu=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,uv.prototype)}},o(zu,"SMIMECapabilities"),zu);C2=uv=f([b({type:g.Sequence,itemType:hv})],C2);var mv,Gu,uf=mv=(Gu=class extends U{constructor(e){super(e),Object.setPrototypeOf(this,mv.prototype)}},o(Gu,"Attributes"),Gu);uf=mv=f([b({type:g.Sequence,itemType:Ye})],uf);var gv=class gv{constructor(e={}){this.version=0,this.subject=new be,this.subjectPKInfo=new ot,this.attributes=new uf,Object.assign(this,e)}};o(gv,"CertificationRequestInfo");var Ur=gv;f([l({type:h.Integer})],Ur.prototype,"version",void 0);f([l({type:be})],Ur.prototype,"subject",void 0);f([l({type:ot})],Ur.prototype,"subjectPKInfo",void 0);f([l({type:uf,implicit:!0,context:0,optional:!0})],Ur.prototype,"attributes",void 0);var vv=class vv{constructor(e={}){this.certificationRequestInfo=new Ur,this.signatureAlgorithm=new k,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};o(vv,"CertificationRequest");var ni=vv;f([l({type:Ur,raw:!0})],ni.prototype,"certificationRequestInfo",void 0);f([l({type:k})],ni.prototype,"signatureAlgorithm",void 0);f([l({type:h.BitString})],ni.prototype,"signature",void 0);var jf="crypto.algorithm",Bv=class Bv{getAlgorithms(){return ke.resolveAll(jf)}toAsnAlgorithm(e){({...e});for(let r of this.getAlgorithms()){let n=r.toAsnAlgorithm(e);if(n)return n}if(/^[0-9.]+$/.test(e.name)){let r=new k({algorithm:e.name});if("parameters"in e){let n=e;r.parameters=n.parameters}return r}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}}};o(Bv,"AlgorithmProvider");var Pv=Bv,ia="crypto.algorithmProvider";ke.registerSingleton(ia,Pv);var Bl,Rt="1.3.36.3.3.2.8.1.1",I2=`${Rt}.1`,O2=`${Rt}.2`,R2=`${Rt}.3`,j2=`${Rt}.4`,N2=`${Rt}.5`,B2=`${Rt}.6`,D2=`${Rt}.7`,q2=`${Rt}.8`,M2=`${Rt}.9`,U2=`${Rt}.10`,$2=`${Rt}.11`,V2=`${Rt}.12`,H2=`${Rt}.13`,L2=`${Rt}.14`,W2="brainpoolP160r1",F2="brainpoolP160t1",K2="brainpoolP192r1",J2="brainpoolP192t1",z2="brainpoolP224r1",G2="brainpoolP224t1",X2="brainpoolP256r1",Z2="brainpoolP256t1",Q2="brainpoolP320r1",Y2="brainpoolP320t1",ex="brainpoolP384r1",tx="brainpoolP384t1",rx="brainpoolP512r1",nx="brainpoolP512t1",Ce="ECDSA",ea,Tf=Bl=(ea=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case Ce.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return V_;case"sha-256":return H_;case"sha-384":return L_;case"sha-512":return W_}else if("namedCurve"in e){let r="";switch(e.namedCurve){case"P-256":r=gg;break;case"K-256":r=Bl.SECP256K1;break;case"P-384":r=vg;break;case"P-521":r=bg;break;case W2:r=I2;break;case F2:r=O2;break;case K2:r=R2;break;case J2:r=j2;break;case z2:r=N2;break;case G2:r=B2;break;case X2:r=D2;break;case Z2:r=q2;break;case Q2:r=M2;break;case Y2:r=U2;break;case ex:r=$2;break;case tx:r=V2;break;case rx:r=H2;break;case nx:r=L2;break}if(r)return new k({algorithm:Qi,parameters:P.serialize(new Br({namedCurve:r}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case Fc:return{name:Ce,hash:{name:"SHA-1"}};case Kc:return{name:Ce,hash:{name:"SHA-256"}};case Jc:return{name:Ce,hash:{name:"SHA-384"}};case zc:return{name:Ce,hash:{name:"SHA-512"}};case Qi:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(P.parse(e.parameters,Br).namedCurve){case gg:return{name:Ce,namedCurve:"P-256"};case Bl.SECP256K1:return{name:Ce,namedCurve:"K-256"};case vg:return{name:Ce,namedCurve:"P-384"};case bg:return{name:Ce,namedCurve:"P-521"};case I2:return{name:Ce,namedCurve:W2};case O2:return{name:Ce,namedCurve:F2};case R2:return{name:Ce,namedCurve:K2};case j2:return{name:Ce,namedCurve:J2};case N2:return{name:Ce,namedCurve:z2};case B2:return{name:Ce,namedCurve:G2};case D2:return{name:Ce,namedCurve:X2};case q2:return{name:Ce,namedCurve:Z2};case M2:return{name:Ce,namedCurve:Q2};case U2:return{name:Ce,namedCurve:Y2};case $2:return{name:Ce,namedCurve:ex};case V2:return{name:Ce,namedCurve:tx};case H2:return{name:Ce,namedCurve:rx};case L2:return{name:Ce,namedCurve:nx}}}}return null}},o(ea,"EcAlgorithm"),ea);Tf.SECP256K1="1.3.132.0.10";Tf=Bl=f([Yn()],Tf);ke.registerSingleton(jf,Tf);var hx=Symbol("name"),yx=Symbol("value"),Dv=class Dv{constructor(e,r={},n=""){this[hx]=e,this[yx]=n;for(let i in r)this[i]=r[i]}};o(Dv,"TextObject");var ce=Dv;ce.NAME=hx;ce.VALUE=yx;var qv=class qv{static toTextObject(e){let r=new ce("Algorithm Identifier",{},Vr.toString(e.algorithm));if(e.parameters)if(e.algorithm===Qi){let n=new Tf().toWebAlgorithm(e);n&&"namedCurve"in n?r["Named Curve"]=n.namedCurve:r.Parameters=e.parameters}else r.Parameters=e.parameters;return r}};o(qv,"DefaultAlgorithmSerializer");var Tv=qv,Mv=class Mv{static toString(e){let r=this.items[e];return r||e}};o(Mv,"OidSerializer");var Vr=Mv;Vr.items={[eo]:"sha1",[bl]:"sha224",[to]:"sha256",[ro]:"sha384",[no]:"sha512",[Dr]:"rsaEncryption",[cu]:"sha1WithRSAEncryption",[G_]:"sha224WithRSAEncryption",[vl]:"sha256WithRSAEncryption",[fu]:"sha384WithRSAEncryption",[du]:"sha512WithRSAEncryption",[Qi]:"ecPublicKey",[Fc]:"ecdsaWithSHA1",[gl]:"ecdsaWithSHA224",[Kc]:"ecdsaWithSHA256",[Jc]:"ecdsaWithSHA384",[zc]:"ecdsaWithSHA512",[__]:"TLS WWW server authentication",[x_]:"TLS WWW client authentication",[A_]:"Code Signing",[S_]:"E-mail Protection",[k_]:"Time Stamping",[C_]:"OCSP Signing",[U_]:"Signed Data"};var Uv=class Uv{static serialize(e){return this.serializeObj(e).join(`
|
|
17
|
-
`)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,r=0){let n=[],i=this.pad(r++),s="",u=e[
|
|
18
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return
|
|
19
|
-
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:
|
|
20
|
-
`)}};o(Lv,"PemConverter");var mt=Lv;mt.CertificateTag="CERTIFICATE";mt.CrlTag="CRL";mt.CertificateRequestTag="CERTIFICATE REQUEST";mt.PublicKeyTag="PUBLIC KEY";mt.PrivateKeyTag="PRIVATE KEY";var Ef=class Ef extends oi{static isAsnEncoded(e){return C.BufferSourceConverter.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(mt.isPem(e))return mt.decode(e)[0];if(C.Convert.isHex(e))return C.Convert.FromHex(e);if(C.Convert.isBase64(e))return C.Convert.FromBase64(e);if(C.Convert.isBase64Url(e))return C.Convert.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{let r=C.BufferSourceConverter.toUint8Array(e);if(r.length>0&&r[0]===48)return C.BufferSourceConverter.toArrayBuffer(e);let n=C.Convert.ToBinary(e);if(mt.isPem(n))return mt.decode(n)[0];if(C.Convert.isHex(n))return C.Convert.FromHex(n);if(C.Convert.isBase64(n))return C.Convert.FromBase64(n);if(C.Convert.isBase64Url(n))return C.Convert.FromBase64Url(n);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){Ef.isAsnEncoded(e[0])?super(Ef.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){return e==="pem"?mt.encode(this.rawData,this.tag):super.toString(e)}};o(Ef,"PemData");var si=Ef,Yu=class Yu extends si{static async create(e,r=yt.get()){if(e instanceof Yu)return e;if(If.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");let n=await r.subtle.exportKey("spki",e);return new Yu(n)}else{if(e.publicKey)return e.publicKey;if(C.BufferSourceConverter.isBufferSource(e))return new Yu(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){si.isAsnEncoded(e)?super(e,ot):super(e),this.tag=mt.PublicKeyTag}async export(...e){let r,n=["verify"],i={hash:"SHA-256",...this.algorithm};e.length>1?(i=e[0]||i,n=e[1]||n,r=e[2]||yt.get()):r=e[0]||yt.get();let s=this.rawData,u=P.parse(this.rawData,ot);return u.algorithm.algorithm===Xn&&(s=Ik(u,s)),r.subtle.importKey("spki",s,i,!0,n)}onInit(e){let r=ke.resolve(ia),n=this.algorithm=r.toWebAlgorithm(e.algorithm);if(e.algorithm.algorithm===Dr){let i=P.parse(e.subjectPublicKey,yu),s=C.BufferSourceConverter.toUint8Array(i.modulus);n.publicExponent=C.BufferSourceConverter.toUint8Array(i.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3}}async getThumbprint(...e){var r;let n,i="SHA-1";return e.length>=1&&!(!((r=e[0])===null||r===void 0)&&r.subtle)?(i=e[0]||i,n=e[1]||yt.get()):n=e[0]||yt.get(),await n.subtle.digest(i,this.rawData)}async getKeyIdentifier(...e){let r,n="SHA-1";e.length===1?typeof e[0]=="string"?(n=e[0],r=yt.get()):r=e[0]:e.length===2?(n=e[0],r=e[1]):r=yt.get();let i=P.parse(this.rawData,ot);return await r.subtle.digest(n,i.subjectPublicKey)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.parse(this.rawData,ot);switch(e.Algorithm=hn.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case Qi:e["EC Point"]=r.subjectPublicKey;break;case Dr:default:e["Raw Data"]=r.subjectPublicKey}return e}};o(Yu,"PublicKey");var ii=Yu;function Ik(t,e){return t.algorithm=new k({algorithm:Dr,parameters:null}),e=P.serialize(t),e}o(Ik,"convertSpkiToRsaPkcs1");var Pf=class Pf extends Ut{static async create(e,r=!1,n=yt.get()){if("name"in e&&"serialNumber"in e)return new Pf(e,r);let s=await(await ii.create(e,n)).getKeyIdentifier(n);return new Pf(C.Convert.ToHex(s),r)}constructor(...e){if(C.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){let r=new Rr({keyIdentifier:new Ni(C.Convert.FromHex(e[0]))});super(zd,e[1],P.serialize(r))}else{let r=e[0],n=r.name instanceof yn?P.parse(r.name.rawData,xe):r.name,i=new Rr({authorityCertIssuer:n,authorityCertSerialNumber:C.Convert.FromHex(r.serialNumber)});super(zd,e[1],P.serialize(i))}}onInit(e){super.onInit(e);let r=P.parse(e.extnValue,Rr);r.keyIdentifier&&(this.keyId=C.Convert.ToHex(r.keyIdentifier)),(r.authorityCertIssuer||r.authorityCertSerialNumber)&&(this.certId={name:r.authorityCertIssuer||[],serialNumber:r.authorityCertSerialNumber?C.Convert.ToHex(r.authorityCertSerialNumber):""})}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.parse(this.value,Rr);return r.authorityCertIssuer&&(e["Authority Issuer"]=new yn(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(e["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(e[""]=r.keyIdentifier),e}};o(Pf,"AuthorityKeyIdentifierExtension");var Ml=Pf;Ml.NAME="Authority Key Identifier";var Wv=class Wv extends Ut{constructor(...e){if(C.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.parse(this.value,Bi);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{let r=new Bi({cA:e[0],pathLenConstraint:e[1]});super(Gd,e[2],P.serialize(r)),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}};o(Wv,"BasicConstraintsExtension");var Ul=Wv;Ul.NAME="Basic Constraints";var cx;(function(t){t.serverAuth="1.3.6.1.5.5.7.3.1",t.clientAuth="1.3.6.1.5.5.7.3.2",t.codeSigning="1.3.6.1.5.5.7.3.3",t.emailProtection="1.3.6.1.5.5.7.3.4",t.timeStamping="1.3.6.1.5.5.7.3.8",t.ocspSigning="1.3.6.1.5.5.7.3.9"})(cx||(cx={}));var Fv=class Fv extends Ut{constructor(...e){if(C.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.parse(this.value,Cc);this.usages=r.map(n=>n)}else{let r=new Cc(e[0]);super(Yd,e[1],P.serialize(r)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(r=>Vr.toString(r)).join(", "),e}};o(Fv,"ExtendedKeyUsageExtension");var $l=Fv;$l.NAME="Extended Key Usages";var fx;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(fx||(fx={}));var Kv=class Kv extends Ut{constructor(...e){if(C.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.parse(this.value,ss);this.usages=r.toNumber()}else{let r=new ss(e[0]);super(el,e[1],P.serialize(r)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.parse(this.value,ss);return e[""]=r.toJSON().join(", "),e}};o(Kv,"KeyUsagesExtension");var Vl=Kv;Vl.NAME="Key Usages";var Zl=class Zl extends Ut{static async create(e,r=!1,n=yt.get()){let s=await(await ii.create(e,n)).getKeyIdentifier(n);return new Zl(C.Convert.ToHex(s),r)}constructor(...e){if(C.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.parse(this.value,Ct);this.keyId=C.Convert.ToHex(r)}else{let r=typeof e[0]=="string"?C.Convert.FromHex(e[0]):e[0],n=new Ct(r);super(om,e[1],P.serialize(n)),this.keyId=C.Convert.ToHex(r)}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.parse(this.value,Ct);return e[""]=r,e}};o(Zl,"SubjectKeyIdentifierExtension");var Hl=Zl;Hl.NAME="Subject Key Identifier";var Jv=class Jv extends Ut{constructor(...e){C.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(rm,e[1],new yn(e[0]||[]).rawData)}onInit(e){super.onInit(e);let r=P.parse(e.extnValue,il);this.names=new yn(r)}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(let n in r)e[n]=r[n];return e}};o(Jv,"SubjectAlternativeNameExtension");var sa=Jv;sa.NAME="Subject Alternative Name";var zv=class zv{static register(e,r){this.items.set(e,r)}static create(e){let r=new Ut(e),n=this.items.get(r.type);return n?new n(e):r}};o(zv,"ExtensionFactory");var gt=zv;gt.items=new Map;var Gv=class Gv extends Ut{constructor(...e){var r;if(C.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let n=P.parse(this.value,_c);this.policies=n.map(i=>i.policyIdentifier)}else{let n=e[0],i=(r=e[1])!==null&&r!==void 0?r:!1,s=new _c(n.map(u=>new Di({policyIdentifier:u})));super(Zd,i,P.serialize(s)),this.policies=n}}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(r=>new ce("",{},Vr.toString(r))),e}};o(Gv,"CertificatePolicyExtension");var Ll=Gv;Ll.NAME="Certificate Policies";gt.register(Zd,Ll);var Xv=class Xv extends Ut{constructor(...e){var r;if(C.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){let i=e[0].map(u=>new jr({distributionPoint:new an({fullName:[new W({uniformResourceIdentifier:u})]})})),s=new Hn(i);super(Qd,e[1],P.serialize(s))}else{let n=new Hn(e[0]);super(Qd,e[1],P.serialize(n))}(r=this.distributionPoints)!==null&&r!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);let r=P.parse(e.extnValue,Hn);this.distributionPoints=r}toTextObject(){let e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(r=>{var n;let i={};return r.distributionPoint&&(i[""]=(n=r.distributionPoint.fullName)===null||n===void 0?void 0:n.map(s=>new $r(s).toString()).join(", ")),r.reasons&&(i.Reasons=r.reasons.toString()),r.cRLIssuer&&(i["CRL Issuer"]=r.cRLIssuer.map(s=>s.toString()).join(", ")),i}),e}};o(Xv,"CRLDistributionPointsExtension");var Wl=Xv;Wl.NAME="CRL Distribution Points";var Zv=class Zv extends Ut{constructor(...e){var r,n,i,s;if(C.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof ji){let u=new ji(e[0]);super(Jd,e[1],P.serialize(u))}else{let u=e[0],a=new ji;Nl(a,u,S0,"ocsp"),Nl(a,u,k0,"caIssuers"),Nl(a,u,C0,"timeStamping"),Nl(a,u,E0,"caRepository"),super(Jd,e[1],P.serialize(a))}(r=this.ocsp)!==null&&r!==void 0||(this.ocsp=[]),(n=this.caIssuers)!==null&&n!==void 0||(this.caIssuers=[]),(i=this.timeStamping)!==null&&i!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],P.parse(e.extnValue,ji).forEach(n=>{switch(n.accessMethod){case S0:this.ocsp.push(new $r(n.accessLocation));break;case k0:this.caIssuers.push(new $r(n.accessLocation));break;case C0:this.timeStamping.push(new $r(n.accessLocation));break;case E0:this.caRepository.push(new $r(n.accessLocation));break}})}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ocsp.length&&jl(e,"OCSP",this.ocsp),this.caIssuers.length&&jl(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&jl(e,"Time Stamping",this.timeStamping),this.caRepository.length&&jl(e,"CA Repository",this.caRepository),e}};o(Zv,"AuthorityInfoAccessExtension");var Fl=Zv;Fl.NAME="Authority Info Access";function jl(t,e,r){if(r.length===1)t[e]=r[0].toTextObject();else{let n=new ce("");r.forEach((i,s)=>{let u=i.toTextObject(),a=`${u[ce.NAME]} ${s+1}`,c=n[a];Array.isArray(c)||(c=[],n[a]=c),c.push(u)}),t[e]=n}}o(jl,"addUrlsToObject");function Nl(t,e,r,n){let i=e[n];i&&(Array.isArray(i)?i:[i]).forEach(u=>{typeof u=="string"&&(u=new $r("url",u)),t.push(new sn({accessMethod:r,accessLocation:P.parse(u.rawData,W)}))})}o(Nl,"addAccessDescriptions");var Qv=class Qv extends Ut{constructor(...e){C.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(J0,e[1],new yn(e[0]||[]).rawData)}onInit(e){super.onInit(e);let r=P.parse(e.extnValue,xe);this.names=new yn(r)}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(let n in r)e[n]=r[n];return e}};o(Qv,"IssuerAlternativeNameExtension");var Kl=Qv;Kl.NAME="Issuer Alternative Name";var Ql=class Ql extends oi{constructor(...e){let r;if(C.BufferSourceConverter.isBufferSource(e[0]))r=C.BufferSourceConverter.toArrayBuffer(e[0]);else{let n=e[0],i=Array.isArray(e[1])?e[1].map(s=>C.BufferSourceConverter.toArrayBuffer(s)):[];r=P.serialize(new Ye({type:n,values:i}))}super(r,Ye)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Value=this.values.map(r=>new ce("",{"":r})),e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty();return e[ce.NAME]===Ql.NAME&&(e[ce.NAME]=Vr.toString(this.type)),e}};o(Ql,"Attribute");var ua=Ql;ua.NAME="Attribute";var Yv=class Yv extends ua{constructor(...e){var r;if(C.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let n=new rf({printableString:e[0]});super(yv,[P.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){let r=P.parse(this.values[0],rf);this.password=r.toString()}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[ce.VALUE]=this.password,e}};o(Yv,"ChallengePasswordAttribute");var Jl=Yv;Jl.NAME="Challenge Password";var eb=class eb extends ua{constructor(...e){var r;if(C.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let n=e[0],i=new Zt;for(let s of n)i.push(P.parse(s.rawData,st));super(of,[P.serialize(i)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){let r=P.parse(this.values[0],Zt);this.items=r.map(n=>gt.create(P.serialize(n)))}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.items.map(n=>n.toTextObject());for(let n of r)e[n[ce.NAME]]=n;return e}};o(eb,"ExtensionsAttribute");var Rf=eb;Rf.NAME="Extensions";var tb=class tb{static register(e,r){this.items.set(e,r)}static create(e){let r=new ua(e),n=this.items.get(r.type);return n?new n(e):r}};o(tb,"AttributeFactory");var aa=tb;aa.items=new Map;var Yl="crypto.signatureFormatter",rb=class rb{toAsnSignature(e,r){return C.BufferSourceConverter.toArrayBuffer(r)}toWebSignature(e,r){return C.BufferSourceConverter.toArrayBuffer(r)}};o(rb,"AsnDefaultSignatureFormatter");var Iv=rb,Dl,ta,Ov=Dl=(ta=class{static createPssParams(e,r){let n=Dl.getHashAlgorithm(e);return n?new qr({hashAlgorithm:n,maskGenAlgorithm:new k({algorithm:Zn,parameters:P.serialize(n)}),saltLength:r}):null}static getHashAlgorithm(e){let r=ke.resolve(ia);return typeof e=="string"?r.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?r.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let r;if(typeof e.hash=="string")r=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")r=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new k({algorithm:cu,parameters:null});case"sha-256":return new k({algorithm:vl,parameters:null});case"sha-384":return new k({algorithm:fu,parameters:null});case"sha-512":return new k({algorithm:du,parameters:null})}}else return new k({algorithm:Dr,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 r=Dl.createPssParams(e.hash,e.saltLength);if(!r)throw new Error("Cannot create PSS parameters");return new k({algorithm:Xn,parameters:P.serialize(r)})}else return new k({algorithm:Xn,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Dr:return{name:"RSASSA-PKCS1-v1_5"};case cu:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case vl:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case fu:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case du:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case Xn:if(e.parameters){let r=P.parse(e.parameters,qr);return{name:"RSA-PSS",hash:ke.resolve(ia).toWebAlgorithm(r.hashAlgorithm),saltLength:r.saltLength}}else return{name:"RSA-PSS"}}return null}},o(ta,"RsaAlgorithm"),ta);Ov=Dl=f([Yn()],Ov);ke.registerSingleton(jf,Ov);var ra,Rv=(ra=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new k({algorithm:eo});case"sha-256":return new k({algorithm:to});case"sha-384":return new k({algorithm:ro});case"sha-512":return new k({algorithm:no})}return null}toWebAlgorithm(e){switch(e.algorithm){case eo:return{name:"SHA-1"};case to:return{name:"SHA-256"};case ro:return{name:"SHA-384"};case no:return{name:"SHA-512"}}return null}},o(ra,"ShaAlgorithm"),ra);Rv=f([Yn()],Rv);ke.registerSingleton(jf,Rv);var lo=class lo{addPadding(e,r){let n=C.BufferSourceConverter.toUint8Array(r),i=new Uint8Array(e);return i.set(n,e-n.length),i.buffer}removePadding(e,r=!1){let n=C.BufferSourceConverter.toUint8Array(e);for(let i=0;i<n.length;i++)if(n[i]){n=n.slice(i);break}if(r&&n[0]>127){let i=new Uint8Array(n.length+1);return i.set(n,1),i.buffer}return n.buffer}toAsnSignature(e,r){if(e.name==="ECDSA"){let n=e.namedCurve,i=lo.namedCurveSize.get(n)||lo.defaultNamedCurveSize,s=new Yi,u=C.BufferSourceConverter.toUint8Array(r);return s.r=this.removePadding(u.slice(0,i),!0),s.s=this.removePadding(u.slice(i,i+i),!0),P.serialize(s)}return null}toWebSignature(e,r){if(e.name==="ECDSA"){let n=P.parse(r,Yi),i=e.namedCurve,s=lo.namedCurveSize.get(i)||lo.defaultNamedCurveSize,u=this.addPadding(s,this.removePadding(n.r)),a=this.addPadding(s,this.removePadding(n.s));return(0,C.combine)(u,a)}return null}};o(lo,"AsnEcSignatureFormatter");var mn=lo;mn.namedCurveSize=new Map;mn.defaultNamedCurveSize=32;var Cv="1.3.101.110",dx="1.3.101.111",Ev="1.3.101.112",lx="1.3.101.113",na,jv=(na=class{toAsnAlgorithm(e){let r=null;switch(e.name.toLowerCase()){case"ed25519":r=Ev;break;case"x25519":r=Cv;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":r=Ev;break;case"ed448":r=lx;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":r=Cv;break;case"x448":r=dx;break}}return r?new k({algorithm:r}):null}toWebAlgorithm(e){switch(e.algorithm){case Ev:return{name:"Ed25519"};case lx:return{name:"EdDSA",namedCurve:"Ed448"};case Cv:return{name:"X25519"};case dx:return{name:"ECDH-ES",namedCurve:"X448"}}return null}},o(na,"EdAlgorithm"),na);jv=f([Yn()],jv);ke.registerSingleton(jf,jv);var af,cf,ff,df,lf,pf,hf,Zu,nb=class nb extends si{get subjectName(){return X(this,cf,"f")||_e(this,cf,new po(this.asn.certificationRequestInfo.subject),"f"),X(this,cf,"f")}get subject(){return X(this,ff,"f")||_e(this,ff,this.subjectName.toString(),"f"),X(this,ff,"f")}get signatureAlgorithm(){if(!X(this,df,"f")){let e=ke.resolve(ia);_e(this,df,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return X(this,df,"f")}get signature(){return X(this,lf,"f")||_e(this,lf,this.asn.signature,"f"),X(this,lf,"f")}get publicKey(){return X(this,pf,"f")||_e(this,pf,new ii(this.asn.certificationRequestInfo.subjectPKInfo),"f"),X(this,pf,"f")}get attributes(){return X(this,hf,"f")||_e(this,hf,this.asn.certificationRequestInfo.attributes.map(e=>aa.create(P.serialize(e))),"f"),X(this,hf,"f")}get extensions(){if(!X(this,Zu,"f")){_e(this,Zu,[],"f");let e=this.getAttribute(of);e instanceof Rf&&_e(this,Zu,e.items,"f")}return X(this,Zu,"f")}get tbs(){return X(this,af,"f")||_e(this,af,this.asn.certificationRequestInfoRaw||P.serialize(this.asn.certificationRequestInfo),"f"),X(this,af,"f")}constructor(e){let r=si.isAsnEncoded(e)?[e,ni]:[e];super(r[0],r[1]),af.set(this,void 0),cf.set(this,void 0),ff.set(this,void 0),df.set(this,void 0),lf.set(this,void 0),pf.set(this,void 0),hf.set(this,void 0),Zu.set(this,void 0),this.tag=mt.CertificateRequestTag}onInit(e){}getAttribute(e){for(let r of this.attributes)if(r.type===e)return r;return null}getAttributes(e){return this.attributes.filter(r=>r.type===e)}getExtension(e){for(let r of this.extensions)if(r.type===e)return r;return null}getExtensions(e){return this.extensions.filter(r=>r.type===e)}async verify(e=yt.get()){let r={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(r,["verify"],e),i=ke.resolveAll(Yl).reverse(),s=null;for(let a of i)if(s=a.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,n,s,this.tbs)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.parse(this.rawData,ni),n=r.certificationRequestInfo,i=new ce("",{Version:`${cn[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let s=new ce("");for(let u of this.attributes){let a=u.toTextObject();s[a[ce.NAME]]=a}i.Attributes=s}return e.Data=i,e.Signature=new ce("",{Algorithm:hn.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),e}};o(nb,"Pkcs10CertificateRequest");var Nv=nb;af=new WeakMap,cf=new WeakMap,ff=new WeakMap,df=new WeakMap,lf=new WeakMap,pf=new WeakMap,hf=new WeakMap,Zu=new WeakMap;Nv.NAME="PKCS#10 Certificate Request";var yf,mf,gf,vf,bf,wf,_f,xf,Af,Sf,Qu,kf,ib=class ib extends si{get publicKey(){return X(this,kf,"f")||_e(this,kf,new ii(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),X(this,kf,"f")}get serialNumber(){if(!X(this,mf,"f")){let e=this.asn.tbsCertificate,r=new Uint8Array(e.serialNumber);r.length>1&&r[0]===0&&r[1]>127&&(r=r.slice(1)),_e(this,mf,C.Convert.ToHex(r),"f")}return X(this,mf,"f")}get subjectName(){return X(this,gf,"f")||_e(this,gf,new po(this.asn.tbsCertificate.subject),"f"),X(this,gf,"f")}get subject(){return X(this,vf,"f")||_e(this,vf,this.subjectName.toString(),"f"),X(this,vf,"f")}get issuerName(){return X(this,bf,"f")||_e(this,bf,new po(this.asn.tbsCertificate.issuer),"f"),X(this,bf,"f")}get issuer(){return X(this,wf,"f")||_e(this,wf,this.issuerName.toString(),"f"),X(this,wf,"f")}get notBefore(){if(!X(this,_f,"f")){let e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");_e(this,_f,e,"f")}return X(this,_f,"f")}get notAfter(){if(!X(this,xf,"f")){let e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");_e(this,xf,e,"f")}return X(this,xf,"f")}get signatureAlgorithm(){if(!X(this,Af,"f")){let e=ke.resolve(ia);_e(this,Af,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return X(this,Af,"f")}get signature(){return X(this,Sf,"f")||_e(this,Sf,this.asn.signatureValue,"f"),X(this,Sf,"f")}get extensions(){return X(this,Qu,"f")||(_e(this,Qu,[],"f"),this.asn.tbsCertificate.extensions&&_e(this,Qu,this.asn.tbsCertificate.extensions.map(e=>gt.create(P.serialize(e))),"f")),X(this,Qu,"f")}get tbs(){return X(this,yf,"f")||_e(this,yf,this.asn.tbsCertificateRaw||P.serialize(this.asn.tbsCertificate),"f"),X(this,yf,"f")}constructor(e){let r=si.isAsnEncoded(e)?[e,yr]:[e];super(r[0],r[1]),yf.set(this,void 0),mf.set(this,void 0),gf.set(this,void 0),vf.set(this,void 0),bf.set(this,void 0),wf.set(this,void 0),_f.set(this,void 0),xf.set(this,void 0),Af.set(this,void 0),Sf.set(this,void 0),Qu.set(this,void 0),kf.set(this,void 0),this.tag=mt.CertificateTag}onInit(e){}getExtension(e){for(let r of this.extensions)if(typeof e=="string"){if(r.type===e)return r}else if(r instanceof e)return r;return null}getExtensions(e){return this.extensions.filter(r=>typeof e=="string"?r.type===e:r instanceof e)}async verify(e={},r=yt.get()){let n,i,s=e.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(n,["verify"],r);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},i=await s.publicKey.export(n,["verify"],r);else if(s instanceof ii)n={...s.algorithm,...this.signatureAlgorithm},i=await s.export(n,["verify"],r);else if(C.BufferSourceConverter.isBufferSource(s)){let d=new ii(s);n={...d.algorithm,...this.signatureAlgorithm},i=await d.export(n,["verify"],r)}else n={...s.algorithm,...this.signatureAlgorithm},i=s}catch{return!1}let u=ke.resolveAll(Yl).reverse(),a=null;for(let d of u)if(a=d.toWebSignature(n,this.signature),a)break;if(!a)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");let c=await r.subtle.verify(this.signatureAlgorithm,i,a,this.tbs);if(e.signatureOnly)return c;{let p=(e.date||new Date).getTime();return c&&this.notBefore.getTime()<p&&p<this.notAfter.getTime()}}async getThumbprint(...e){let r,n="SHA-1";return e[0]&&(e[0].subtle?r=e[0]:(n=e[0]||n,r=e[1])),r??(r=yt.get()),await r.subtle.digest(n,this.rawData)}async isSelfSigned(e=yt.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.parse(this.rawData,yr),n=r.tbsCertificate,i=new ce("",{Version:`${cn[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":hn.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new ce("",{"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 s=new ce("");for(let u of this.extensions){let a=u.toTextObject();s[a[ce.NAME]]=a}i.Extensions=s}return e.Data=i,e.Signature=new ce("",{Algorithm:hn.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),e}};o(ib,"X509Certificate");var ca=ib;yf=new WeakMap,mf=new WeakMap,gf=new WeakMap,vf=new WeakMap,bf=new WeakMap,wf=new WeakMap,_f=new WeakMap,xf=new WeakMap,Af=new WeakMap,Sf=new WeakMap,Qu=new WeakMap,kf=new WeakMap;ca.NAME="Certificate";var Ok,Rk,jk,Nk,Bk,px;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(px||(px={}));Ok=new WeakMap,Rk=new WeakMap,jk=new WeakMap,Nk=new WeakMap,Bk=new WeakMap;var Dk,qk,Mk,Uk,$k,Vk,Hk;Dk=new WeakMap,qk=new WeakMap,Mk=new WeakMap,Uk=new WeakMap,$k=new WeakMap,Vk=new WeakMap,Hk=new WeakMap;gt.register(Gd,Ul);gt.register(Yd,$l);gt.register(el,Vl);gt.register(om,Hl);gt.register(zd,Ml);gt.register(rm,sa);gt.register(Qd,Wl);gt.register(Jd,Fl);gt.register(J0,Kl);aa.register(yv,Jl);aa.register(of,Rf);ke.registerSingleton(Yl,Iv);ke.registerSingleton(Yl,mn);mn.namedCurveSize.set("P-256",32);mn.namedCurveSize.set("K-256",32);mn.namedCurveSize.set("P-384",48);mn.namedCurveSize.set("P-521",66);var Wk=["pre-registered","redirect_uri","https","did","verifier_attestation","x509_san_dns","x509_hash"],ep=o((t,e)=>{if(typeof t!="string"||t.length===0)return{prefix:"pre-registered",value:"",inferred:!0};if(typeof e=="string"&&e.length>0&&Fk(e))return{prefix:e,value:t,inferred:!1};let r=["redirect_uri","verifier_attestation","x509_san_dns","x509_hash"];for(let n of r){let i=`${n}:`;if(t.startsWith(i))return{prefix:n,value:t.slice(i.length),inferred:!1}}return t.startsWith("https://")?{prefix:"https",value:t,inferred:!0}:/^did:[a-z0-9]+:/.test(t)?{prefix:"did",value:t,inferred:!0}:{prefix:"pre-registered",value:t,inferred:!0}},"deriveClientIdPrefix"),Fk=o(t=>Wk.includes(t),"isKnownPrefix");var ob;function sb(t){return{lang:t?.lang??ob?.lang,message:t?.message,abortEarly:t?.abortEarly??ob?.abortEarly,abortPipeEarly:t?.abortPipeEarly??ob?.abortPipeEarly}}o(sb,"getGlobalConfig");var Kk;function Jk(t){return Kk?.get(t)}o(Jk,"getGlobalMessage");var zk;function Gk(t){return zk?.get(t)}o(Gk,"getSchemaMessage");var Xk;function Zk(t,e){return Xk?.get(t)?.get(e)}o(Zk,"getSpecificMessage");function Nf(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}o(Nf,"_stringify");function Ae(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,u=i?.expected??t.expects??null,a=i?.received??Nf(s),c={kind:t.kind,type:t.type,input:s,expected:u,received:a,message:`Invalid ${e}: ${u?`Expected ${u} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},d=t.kind==="schema",p=i?.message??t.message??Zk(t.reference,c.lang)??(d?Gk(c.lang):null)??n.message??Jk(c.lang);p!==void 0&&(c.message=typeof p=="function"?p(c):p),d&&(r.typed=!1),r.issues?r.issues.push(c):r.issues=[c]}o(Ae,"_addIssue");function je(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},sb())}}}o(je,"_getStandardProps");function Qk(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}o(Qk,"_isValidObjectKey");function ub(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}o(ub,"_joinExpects");function Yk(t){if(t.path){let e="";for(let r of t.path)if(typeof r.key=="string"||typeof r.key=="number")e?e+=`.${r.key}`:e+=r.key;else return null;return e}return null}o(Yk,"getDotPath");var fa,ab=(fa=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}},o(fa,"ValiError"),fa);function Bf(t,e){return{kind:"validation",type:"check",reference:Bf,async:!1,expects:null,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement(r.value)&&Ae(this,"input",r,n),r}}}o(Bf,"check");function G(t){return{kind:"metadata",type:"description",reference:G,description:t}}o(G,"description");function tp(t){return{kind:"validation",type:"integer",reference:tp,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&Ae(this,"integer",e,r),e}}}o(tp,"integer");function cb(t,e){return{kind:"validation",type:"min_value",reference:cb,async:!1,expects:`>=${t instanceof Date?t.toJSON():Nf(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value>=this.requirement)&&Ae(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():Nf(r.value)}),r}}}o(cb,"minValue");function fb(t){return{kind:"validation",type:"non_empty",reference:fb,async:!1,expects:"!0",message:t,"~run"(e,r){return e.typed&&e.value.length===0&&Ae(this,"length",e,r,{received:"0"}),e}}}o(fb,"nonEmpty");function ho(t){return{kind:"transformation",type:"raw_transform",reference:ho,async:!1,"~run"(e,r){let n=t({dataset:e,config:r,addIssue:o(i=>Ae(this,i?.label??"input",e,r,i),"addIssue"),NEVER:null});return e.issues?e.typed=!1:e.value=n,e}}}o(ho,"rawTransform");function Df(t,e){return{kind:"validation",type:"regex",reference:Df,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement.test(r.value)&&Ae(this,"format",r,n),r}}}o(Df,"regex");function db(t,e){return{kind:"validation",type:"some_item",reference:db,async:!1,expects:null,requirement:t,message:e,"~run"(r,n){return r.typed&&!r.value.some(this.requirement)&&Ae(this,"item",r,n),r}}}o(db,"someItem");function lb(t){return{kind:"transformation",type:"transform",reference:lb,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}o(lb,"transform");function rp(t){return{kind:"validation",type:"url",reference:rp,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&Ae(this,"URL",e,r),e}}}o(rp,"url");function eC(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}o(eC,"getFallback");function qf(t){let e={};for(let r of t)if(r.path){let n=Yk(r);n?(e.nested||(e.nested={}),e.nested[n]?e.nested[n].push(r.message):e.nested[n]=[r.message]):e.other?e.other.push(r.message):e.other=[r.message]}else e.root?e.root.push(r.message):e.root=[r.message];return e}o(qf,"flatten");function bx(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}o(bx,"getDefault");function pb(t,e){return!t["~run"]({value:e},{abortEarly:!0}).issues}o(pb,"is");function Mf(){return{kind:"schema",type:"any",reference:Mf,expects:"any",async:!1,get"~standard"(){return je(this)},"~run"(t){return t.typed=!0,t}}}o(Mf,"any");function jt(t,e){return{kind:"schema",type:"array",reference:jt,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return je(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let u=i[s],a=this.item["~run"]({value:u},n);if(a.issues){let c={type:"array",origin:"value",input:i,key:s,value:u};for(let d of a.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else Ae(this,"type",r,n);return r}}}o(jt,"array");function vr(t){return{kind:"schema",type:"boolean",reference:vr,expects:"boolean",async:!1,message:t,get"~standard"(){return je(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:Ae(this,"type",e,r),e}}}o(vr,"boolean");function Uf(t,e){return{kind:"schema",type:"custom",reference:Uf,expects:"unknown",async:!1,check:t,message:e,get"~standard"(){return je(this)},"~run"(r,n){return this.check(r.value)?r.typed=!0:Ae(this,"type",r,n),r}}}o(Uf,"custom");function np(t){return{kind:"schema",type:"lazy",reference:np,expects:"unknown",async:!1,getter:t,get"~standard"(){return je(this)},"~run"(e,r){return this.getter(e.value)["~run"](e,r)}}}o(np,"lazy");function he(t,e){return{kind:"schema",type:"literal",reference:he,expects:Nf(t),async:!1,literal:t,message:e,get"~standard"(){return je(this)},"~run"(r,n){return r.value===this.literal?r.typed=!0:Ae(this,"type",r,n),r}}}o(he,"literal");function ip(t){return{kind:"schema",type:"null",reference:ip,expects:"null",async:!1,message:t,get"~standard"(){return je(this)},"~run"(e,r){return e.value===null?e.typed=!0:Ae(this,"type",e,r),e}}}o(ip,"null_");function rt(t){return{kind:"schema",type:"number",reference:rt,expects:"number",async:!1,message:t,get"~standard"(){return je(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ae(this,"type",e,r),e}}}o(rt,"number");function F(t,e){return{kind:"schema",type:"object",reference:F,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return je(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let u=this.entries[s];if(s in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){let a=s in i?i[s]:bx(u),c=u["~run"]({value:a},n);if(c.issues){let d={type:"object",origin:"value",input:i,key:s,value:a};for(let p of c.issues)p.path?p.path.unshift(d):p.path=[d],r.issues?.push(p);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),r.value[s]=c.value}else if(u.fallback!==void 0)r.value[s]=eC(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(Ae(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else Ae(this,"type",r,n);return r}}}o(F,"object");function Q(t,e){return{kind:"schema",type:"optional",reference:Q,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return je(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=bx(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}o(Q,"optional");function yo(t,e){return{kind:"schema",type:"picklist",reference:yo,expects:ub(t.map(Nf),"|"),async:!1,options:t,message:e,get"~standard"(){return je(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:Ae(this,"type",r,n),r}}}o(yo,"picklist");function vt(t,e,r){return{kind:"schema",type:"record",reference:vt,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return je(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let u in s)if(Qk(s,u)){let a=s[u],c=this.key["~run"]({value:u},i);if(c.issues){let p={type:"object",origin:"key",input:s,key:u,value:a};for(let y of c.issues)y.path=[p],n.issues?.push(y);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}let d=this.value["~run"]({value:a},i);if(d.issues){let p={type:"object",origin:"value",input:s,key:u,value:a};for(let y of d.issues)y.path?y.path.unshift(p):y.path=[p],n.issues?.push(y);if(n.issues||(n.issues=d.issues),i.abortEarly){n.typed=!1;break}}(!c.typed||!d.typed)&&(n.typed=!1),c.typed&&(n.value[c.value]=d.value)}}else Ae(this,"type",n,i);return n}}}o(vt,"record");function ie(t){return{kind:"schema",type:"string",reference:ie,expects:"string",async:!1,message:t,get"~standard"(){return je(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:Ae(this,"type",e,r),e}}}o(ie,"string");function hb(t,e){return{kind:"schema",type:"tuple",reference:hb,expects:"Array",async:!1,items:t,message:e,get"~standard"(){return je(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<this.items.length;s++){let u=i[s],a=this.items[s]["~run"]({value:u},n);if(a.issues){let c={type:"array",origin:"value",input:i,key:s,value:u};for(let d of a.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else Ae(this,"type",r,n);return r}}}o(hb,"tuple");function br(t){return{kind:"schema",type:"undefined",reference:br,expects:"undefined",async:!1,message:t,get"~standard"(){return je(this)},"~run"(e,r){return e.value===void 0?e.typed=!0:Ae(this,"type",e,r),e}}}o(br,"undefined_");function vx(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}o(vx,"_subIssues");function Ee(t,e){return{kind:"schema",type:"union",reference:Ee,expects:ub(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return je(this)},"~run"(r,n){let i,s,u;for(let a of this.options){let c=a["~run"]({value:r.value},n);if(c.typed)if(c.issues)s?s.push(c):s=[c];else{i=c;break}else u?u.push(c):u=[c]}if(i)return i;if(s){if(s.length===1)return s[0];Ae(this,"type",r,n,{issues:vx(s)}),r.typed=!0}else{if(u?.length===1)return u[0];Ae(this,"type",r,n,{issues:vx(u)})}return r}}}o(Ee,"union");function rr(){return{kind:"schema",type:"unknown",reference:rr,expects:"unknown",async:!1,get"~standard"(){return je(this)},"~run"(t){return t.typed=!0,t}}}o(rr,"unknown");function gn(t,e,r){return{kind:"schema",type:"variant",reference:gn,expects:"Object",async:!1,key:t,options:e,message:r,get"~standard"(){return je(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){let u,a=0,c=this.key,d=[],p=o((y,v)=>{for(let x of y.options){if(x.type==="variant")p(x,new Set(v).add(x.key));else{let A=!0,B=0;for(let I of v){let J=x.entries[I];if(I in s?J["~run"]({typed:!1,value:s[I]},{abortEarly:!0}).issues:J.type!=="exact_optional"&&J.type!=="optional"&&J.type!=="nullish"){A=!1,c!==I&&(a<B||a===B&&I in s&&!(c in s))&&(a=B,c=I,d=[]),c===I&&d.push(x.entries[I].expects);break}B++}if(A){let I=x["~run"]({value:s},i);(!u||!u.typed&&I.typed)&&(u=I)}}if(u&&!u.issues)break}},"parseOptions");if(p(this,new Set([this.key])),u)return u;Ae(this,"type",n,i,{input:s[c],expected:ub(d,"|"),path:[{type:"object",origin:"value",input:s,key:c,value:s[c]}]})}else Ae(this,"type",n,i);return n}}}o(gn,"variant");function wx(t,e){return{...t,get"~standard"(){return je(this)},"~run"(r,n){return t["~run"](r,{...n,message:e})}}}o(wx,"message");function _x(t,e){let r={...t.entries};for(let n of e)delete r[n];return{...t,entries:r,get"~standard"(){return je(this)}}}o(_x,"omit");function $f(t,e,r){let n=t["~run"]({value:e},sb(r));if(n.issues)throw new ab(n.issues);return n.value}o($f,"parse");function op(t,e){let r={};for(let n of e)r[n]=t.entries[n];return{...t,entries:r,get"~standard"(){return je(this)}}}o(op,"pick");function H(...t){return{...t[0],pipe:t,get"~standard"(){return je(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}o(H,"pipe");function Hr(t,e,r){let n=t["~run"]({value:e},sb(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}o(Hr,"safeParse");function rC(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}o(rC,"isObject");var la,nC=(la=class extends Error{},o(la,"UnknownCauseError"),la);function iC(t){if(t instanceof Error)return t;let e=typeof t;if(!(e==="undefined"||e==="function"||t===null)){if(e!=="object")return new Error(String(t));if(rC(t)){let r=new nC;for(let n in t)r[n]=t[n];return r}}}o(iC,"getCauseFromUnknown");var pa,Lr=(pa=class extends Error{constructor(e){let r=iC(e.cause),n=e.message??r?.message??e.code;super(n,{cause:r}),this.code=e.code,this.name="DcqlError",this.cause||(this.cause=r)}},o(pa,"DcqlError"),pa),ha,oC=(ha=class extends Lr{constructor(e){super({code:"BAD_REQUEST",...e})}},o(ha,"DcqlCredentialSetError"),ha),ya,sC=(ya=class extends Lr{constructor(e){super({code:"BAD_REQUEST",...e})}},o(ya,"DcqlUndefinedClaimSetIdError"),ya),ma,uC=(ma=class extends Lr{constructor(e){super({code:"BAD_REQUEST",...e})}},o(ma,"DcqlNonUniqueCredentialQueryIdsError"),ma),ga,Ix=(ga=class extends Lr{constructor(e){super({code:"PARSE_ERROR",...e})}},o(ga,"DcqlParseError"),ga);var va,aC=(va=class extends Lr{constructor(e){super({code:"BAD_REQUEST",...e})}},o(va,"DcqlInvalidPresentationRecordError"),va),ba,yb=(ba=class extends Lr{constructor(e){super({code:"BAD_REQUEST",...e})}},o(ba,"DcqlPresentationResultError"),ba),Ox=/^[a-zA-Z0-9_-]+$/;function vn(t){return t.length>0?t:void 0}o(vn,"asNonEmptyArrayOrUndefined");function Rx(t){return t.length>0}o(Rx,"isNonEmptyArray");var se=o(t=>H(jt(t,e=>`Expected input to be an array, but received '${e.received}'`),Uf(e=>e.length>0,"Array must be non-empty and have length of at least 1")),"vNonEmptyArray"),cC=o(t=>Uf(e=>Array.isArray(e)?t.every(r=>e.includes(r)):!1,`Value must include all of: ${t.join(", ")}`),"vIncludesAll"),wr=H(ie(),Df(Ox),fb()),fC=Df(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==)?|[\w-]{3}=?)?$/iu,"must be base64url");function dC(t){return t===null||typeof t!="object"?!1:typeof t.toJson=="function"}o(dC,"isToJsonable");var lC=o(t=>H(Uf(()=>!0),ho(({dataset:e,addIssue:r,NEVER:n})=>{let i=Hr(t,e.value);if(i.success)return e.value;if(!dC(e.value)){for(let a of i.issues)r({...a,expected:a.expected??void 0});return n}let s;try{s=e.value.toJson()}catch{for(let a of i.issues)r({...a,expected:a.expected??void 0});return r({message:"Json Transformation failed"}),n}let u=Hr(t,s);if(u.success)return e.value;for(let a of u.issues)r({...a,expected:a.expected??void 0});return n})),"vWithJT"),jx=Ee([ie(),rt(),vr(),ip()]),Vf=np(()=>Ee([jx,jt(Vf),vt(ie(),Vf)])),AZ=np(()=>lC(Ee([jx,jt(Vf),vt(ie(),Vf)]))),xb=vt(ie(),Vf),pC=ho(({dataset:t,addIssue:e,NEVER:r})=>{try{return JSON.parse(t.value)}catch{return e({message:"Invalid JSON"}),r}});function xx(t,e){let r=H(Q(t,()=>{}),t);return e?wx(r,e):r}o(xx,"vCustomRequiredMessage");var hC=o(t=>H(F({type:he(t.type,e=>`Expected trusted authority type to be '${t.type}' but received ${typeof e.input=="string"?`'${e.input}'`:e.input}`),values:H(se(ie()),db(e=>t.values.includes(e),e=>`Expected one of the trusted authority values to be '${t.values.join("' | '")}' but received '${e.input.join("' , '")}'`))},`Expected trusted authority object with type '${t.type}' to be defined, but received undefined`),lb(({values:e,...r})=>({...r,value:e.find(n=>t.values.includes(n))}))),"getTrustedAuthorityParser"),Nx=[F({type:he("aki"),values:se(H(ie("aki trusted authority value must be a string"),fC,G("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.")))}),F({type:he("etsi_tl"),values:se(H(ie("etsi_tl trusted authority value must be a string"),rp("etsi_tl trusted authority value must be a valid https url"),Bf(t=>t.startsWith("http://")||t.startsWith("https://"),"etsi_tl trusted authority value must be a valid https url"),G("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.")))}),F({type:he("openid_federation"),values:se(H(ie("openid_federation trusted authority value must be a string"),rp("openid_federation trusted authority value must be a valid https url"),Bf(t=>t.startsWith("http://")||t.startsWith("https://"),"openid_federation trusted authority value must be a valid https url"),G("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.")))})],mb;(function(t){let e=Nx.map(r=>F({type:H(r.entries.type,G("REQUIRED. A string uniquely identifying the type of information about the issuer trust framework.")),values:H(se(r.entries.values.item),G("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."))}));t.vModel=gn("type",e)})(mb||(mb={}));var up;(function(t){t.vModel=gn("type",Nx)})(up||(up={}));var wa,ui=(wa=class{constructor(e){this.input=e}get v(){return this.input.vModel}parse(e){let r=this.safeParse(e);return r.success?r.output:new Ix({message:JSON.stringify(r.flattened),cause:r.error})}safeParse(e){let r=Hr(this.input.vModel,e);return r.success?{success:!0,output:r.output}:{success:!1,error:new ab(r.issues),flattened:qf(r.issues)}}is(e){return pb(this.v,e)}},o(wa,"ModelDefinition"),wa),Ab=F({authority:Q(up.vModel),cryptographic_holder_binding:H(vr(),G("Indicates support/inclusion of cryptographic holder binding. This will be checked against the `require_cryptographic_holder_binding` property from the query."))}),_a;(function(t){let e=t.vNamespaces=vt(ie(),vt(ie(),rr()));t.model=new ui({vModel:t.vModel=F({...Ab.entries,credential_format:he("mso_mdoc"),doctype:ie(),namespaces:e})})})(_a||(_a={}));var xa;(function(t){let e=t.vClaims=xb;t.model=new ui({vModel:t.vModel=F({...Ab.entries,credential_format:yo(["vc+sd-jwt","dc+sd-jwt"]),vct:ie(),claims:e})})})(xa||(xa={}));var Aa;(function(t){let e=t.vClaims=xb;t.model=new ui({vModel:t.vModel=F({...Ab.entries,credential_format:yo(["ldp_vc","jwt_vc_json","vc+sd-jwt"]),claims:e,type:jt(ie())})})})(Aa||(Aa={}));var Ax;(function(t){t.model=new ui({vModel:t.vModel=gn("credential_format",[_a.vModel,xa.vModel,Aa.vModel])})})(Ax||(Ax={}));var gb;(function(t){t.model=new ui({vModel:t.vModel=_a.vModel})})(gb||(gb={}));var vb;(function(t){t.model=new ui({vModel:t.vModel=xa.vModel})})(vb||(vb={}));var bb;(function(t){t.model=new ui({vModel:t.vModel=Aa.vModel})})(bb||(bb={}));var Sx;(function(t){t.model=new ui({vModel:gn("credential_format",[gb.vModel,vb.vModel,bb.vModel])})})(Sx||(Sx={}));var kx;(function(t){let e=Ee([ie(),xb]),r=t.vModel=H(Ee([vt(wr,se(e)),vt(wr,e)]),G("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."));t.parse=n=>typeof n=="string"?$f(H(ie(),pC,r),n):$f(r,n),t.encode=n=>JSON.stringify(n)})(kx||(kx={}));var da;(function(t){let e=t.vValue=Ee([ie(),H(rt(),tp()),vr()]),r=t.vPath=Ee([ie(),H(rt(),tp(),cb(0)),ip()]),n=t.vW3cSdJwtVc=F({id:H(Q(wr),G("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:H(se(r),G("A non-empty array representing a claims path pointer that specifies the path to a claim within the Verifiable Credential.")),values:H(Q(jt(e)),G("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=F({id:H(Q(wr),G("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:H(Q(jt(e)),G("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."))}),s=t.vMdocNamespace=F({...i.entries,namespace:H(ie(),G("A string that specifies the namespace of the data element within the mdoc, e.g., org.iso.18013.5.1.")),claim_name:H(ie(),G("A string that specifies the data element identifier of the data element within the provided namespace in the mdoc, e.g., first_name."))}),u=t.vMdocPath=F({...i.entries,intent_to_retain:H(Q(vr()),G("A boolean that is equivalent to `IntentToRetain` variable defined in Section 8.3.2.1.2.1 of [@ISO.18013-5].")),path:H(hb([H(ie(),G("A string that specifies the namespace of the data element within the mdoc, e.g., org.iso.18013.5.1.")),H(ie(),G("A string that specifies the data element identifier of the data element within the provided namespace in the mdoc, e.g., first_name."))]),G("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."))}),a=t.vMdoc=Ee([s,u]);t.vModel=Ee([a,n])})(da||(da={}));function wb(t,e){let r=e;if(Object.getPrototypeOf(t)!==Object.prototype&&!Array.isArray(t))throw new Lr({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 Lr({message:"target value provided to deepMerge is neither an array or object.",code:"PARSE_ERROR"});for(let[n,i]of Object.entries(t))if(i!==null&&typeof i=="object"&&(Object.getPrototypeOf(i)===Object.prototype||Array.isArray(i))){let s=wb(i,r[n]??new(Object.getPrototypeOf(i)).constructor);r=Cx(r,n,s)}else i!=null&&(r=Cx(r,n,i));return r}o(wb,"deepMerge");function Cx(t,e,r){let n=t;if(Array.isArray(n))n=[...n],n[e]=r;else if(Object.getPrototypeOf(n)===Object.prototype)n={...n,[e]:r};else throw new Lr({message:"Unsupported type for deep merge. Only primitive types or Array and Object are supported",code:"INTERNAL_SERVER_ERROR"});return n}o(Cx,"setValue");var bn=o(t=>t.map(e=>typeof e=="string"?`'${e}'`:`${e}`).join("."),"pathToString"),Bx=o((t,e)=>e?Ee(e.map(r=>he(r,n=>`Expected claim ${bn(t)} to be ${typeof r=="string"?`'${r}'`:r} but received ${typeof n.input=="string"?`'${n.input}'`:n.input}`)),r=>`Expected claim ${bn(t)} to be ${e.map(n=>typeof n=="string"?`'${n}'`:n).join(" | ")} but received ${typeof r.input=="string"?`'${r.input}'`:r.input}`):H(rr(),Bf(r=>r!=null,`Expected claim '${t.join("'.'")}' to be defined`)),"getClaimParser"),yC=o(t=>{let e=pb(da.vMdocNamespace,t)?{id:t.id,path:[t.namespace,t.claim_name],values:t.values}:t,r=e.path[0],n=e.path[1];return F({[r]:F({[n]:Bx(e.path,t.values)},`Expected claim ${bn(e.path)} to be defined`)},`Expected claim ${bn(e.path)} to be defined`)},"getMdocClaimParser"),sp=o((t,e)=>{let{index:r,presentation:n}=e,i=t.path[r],s=r===t.path.length-1,u=Bx(t.path,t.values);if(typeof i=="number"){let a=s?u:sp(t,{...e,index:r+1});return n?H(jt(Mf(),`Expected path ${bn(t.path.slice(0,r+1))} to be an array`),ho(({dataset:c,addIssue:d})=>{let p=[];for(let y of c.value){let v=Hr(a,y);if(v.success)return c.value;p.push(v.issues[0])}return d({...p[0],message:s?p[0].message:`Expected any element in array ${bn(t.path.slice(0,r+1))} to match sub requirement but none matched: ${p[0].message}`}),c.value})):H(jt(Mf(),`Expected path ${bn(t.path.slice(0,r+1))} to be an array`),ho(({addIssue:c,dataset:d,NEVER:p})=>{let y=Hr(a,d.value[i]);return y.success?[...d.value.slice(0,i).map(()=>null),y.output]:(c(y.issues[0]),p)}))}return typeof i=="string"?F({[i]:s?u:sp(t,{...e,index:r+1})},`Expected claim ${bn(t.path)} to be defined`):H(jt(Mf(),`Expected path ${bn(t.path.slice(0,r+1))} to be an array`),ho(({addIssue:a,dataset:c,NEVER:d})=>{let p=c.value.map(y=>Hr(s?u:sp(t,{...e,index:r+1}),y));if(p.every(y=>!y.success)){for(let y of p)for(let v of y.issues)a(v);return d}return p.map(y=>y.success?y.output:null)}))},"getJsonClaimParser"),mC=o((t,e)=>{if(!t.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 r=[],n=[];for(let[u,a]of t.claims.entries()){let c=t.format==="mso_mdoc"?yC(a):sp(a,{index:0,presentation:e.presentation}),d=Hr(c,e.credential.credential_format==="mso_mdoc"?e.credential.namespaces:e.credential.claims);if(d.success)n.push({success:!0,claim_index:u,claim_id:a.id,output:d.output,parser:c});else{let p=qf(d.issues);r.push({success:!1,issues:p.nested??p,claim_index:u,claim_id:a.id,output:d.output,parser:c})}}let i=[],s=[];for(let[u,a]of t.claim_sets?.entries()??[[void 0,void 0]]){let c=a?.map(d=>{let p=n.find(y=>y.claim_id===d)??r.find(y=>y.claim_id===d);if(!p)throw new Ix({message:`Claim with id '${d}' in query '${t.id}' from claim set with index '${u}' not found in claims of claim`});return p})??[...n,...r];if(c.every(d=>d.success)){let d=c.reduce((p,y)=>wb(y.output,p),{});s.push({success:!0,claim_set_index:u,output:d,valid_claim_indexes:vn(c.map(p=>p.claim_index))})}else{let d=r.reduce((p,y)=>wb(y.issues,p),{});i.push({success:!1,issues:d,claim_set_index:u,failed_claim_indexes:c.filter(p=>!p.success).map(p=>p.claim_index),valid_claim_indexes:vn(c.filter(p=>p.success).map(p=>p.claim_index))})}}return Rx(s)?{success:!0,failed_claim_sets:vn(i),valid_claim_sets:s,valid_claims:vn(n.map(({parser:u,...a})=>a)),failed_claims:vn(r.map(({parser:u,...a})=>a))}:{success:!1,failed_claim_sets:i,failed_claims:r.map(({parser:u,...a})=>a),valid_claims:vn(n.map(({parser:u,...a})=>a))}},"runClaimsQuery"),Sb=o(t=>F({cryptographic_holder_binding:t.require_cryptographic_holder_binding?he(!0,e=>`Expected cryptographic_holder_binding to be true (because credential query '${t.id}' requires cryptographic holder binding), but received ${e.input}`):vr()}),"getCryptographicHolderBindingValue"),gC=o(t=>{let e=t.meta?.doctype_value?he(t.meta.doctype_value,r=>`Expected doctype to be '${t.meta?.doctype_value}' but received '${r.input}'`):ie("Expected doctype to be defined");return F({credential_format:he("mso_mdoc",r=>`Expected credential format to be 'mso_mdoc' but received '${r.input}'`),doctype:e,...Sb(t).entries})},"getMdocMetaParser"),Ex=o(t=>F({credential_format:he(t.format,e=>`Expected credential format to be '${t.format}' but received '${e.input}'`),vct:t.meta?.vct_values?xx(yo(t.meta.vct_values,e=>`Expected vct to be '${t.meta?.vct_values?.join("' | '")}' but received '${e.input}'`),e=>`Expected vct to be '${t.meta?.vct_values?.join("' | '")}' but received '${e.input}'`):xx(ie("Expected vct to be a string"),"Expected vct to be defined"),...Sb(t).entries}),"getSdJwtVcMetaParser"),Px=o(t=>F({credential_format:he(t.format,e=>`Expected credential format to be '${t.format}' but received '${e.input}'`),type:t.meta?.type_values?Ee(t.meta.type_values.map(e=>cC(e)),`Expected type to include all values from one of the following subsets: ${t.meta.type_values.map(e=>`[${e.join(", ")}]`).join(" | ")}`):se(ie()),...Sb(t).entries}),"getW3cVcMetaParser"),vC=o(t=>{if(t.format==="mso_mdoc")return gC(t);if(t.format==="dc+sd-jwt")return Ex(t);if(t.format==="vc+sd-jwt")return t.meta&&"type_values"in t.meta?Px(t):Ex(t);if(t.format==="ldp_vc"||t.format==="jwt_vc_json")return Px(t);throw new Lr({code:"NOT_IMPLEMENTED",message:`Unsupported format '${t.format}'`})},"getMetaParser"),bC=o((t,e)=>{let r=vC(t),n=Hr(r,e);if(!n.success){let i=qf(n.issues);return{success:!1,issues:i.nested??i,output:n.output}}return{success:!0,output:n.output}},"runMetaQuery"),wC=o((t,e)=>{if(!t.trusted_authorities)return{success:!0};let r=[];for(let[n,i]of t.trusted_authorities.entries()){let s=hC(i),u=Hr(s,e.authority);if(u.success)return{success:!0,valid_trusted_authority:{success:!0,trusted_authority_index:n,output:u.output},failed_trusted_authorities:vn(r)};let a=qf(u.issues);r.push({success:!1,trusted_authority_index:n,issues:a.nested??a,output:u.output})}return{success:!1,failed_trusted_authorities:r}},"runTrustedAuthoritiesQuery"),Dx=o((t,e)=>{let{credentials:r,presentation:n}=e,i=[],s=[];for(let[u,a]of r.entries()){let c=wC(t,a),d=mC(t,{credential:a,presentation:n}),p=bC(t,a);d.success&&c.success&&p.success?i.push({success:!0,input_credential_index:u,trusted_authorities:c,meta:p,claims:d}):s.push({success:!1,input_credential_index:u,trusted_authorities:c,meta:p,claims:d})}return Rx(i)?{success:!0,credential_query_id:t.id,failed_credentials:vn(s),valid_credentials:i}:{success:!1,credential_query_id:t.id,failed_credentials:vn(s),valid_credentials:void 0}},"runCredentialQuery"),Hf;(function(t){let e=F({id:H(ie(),Df(Ox),G("REQUIRED. A string identifying the Credential in the response and, if provided, the constraints in 'credential_sets'.")),require_cryptographic_holder_binding:H(Q(vr(),!0),G("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:H(Q(vr(),!1),G("OPTIONAL. A boolean which indicates whether multiple Credentials can be returned for this Credential Query. If omitted, the default value is false.")),claim_sets:H(Q(se(se(wr))),G("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:H(Q(se(mb.vModel)),G("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."))}),r=t.vMdoc=F({...e.entries,format:H(he("mso_mdoc"),G("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:H(Q(se(da.vMdoc)),G("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:H(Q(F({doctype_value:H(Q(ie()),G("OPTIONAL. String that specifies an allowed value for the doctype of the requested Verifiable Credential."))})),G("OPTIONAL. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))}),n=t.vSdJwtVc=F({...e.entries,format:H(yo(["vc+sd-jwt","dc+sd-jwt"]),G("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:H(Q(se(da.vW3cSdJwtVc)),G("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:H(Q(H(F({vct_values:Q(jt(ie()))}),G("OPTIONAL. An array of strings that specifies allowed values for the type of the requested Verifiable Credential."))),G("OPTIONAL. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))}),i=t.vW3cVc=F({...e.entries,format:H(yo(["jwt_vc_json","ldp_vc","vc+sd-jwt"]),G("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:H(Q(se(da.vW3cSdJwtVc)),G("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:H(H(F({type_values:H(se(se(ie())),G("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."))})),G("REQUIRED. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))});t.vModel=gn("format",[r,i,n]),t.validate=s=>{_C(s)}})(Hf||(Hf={}));var _C=o(t=>{if(!t.claim_sets)return;let e=new Set(t.claims?.map(n=>n.id)),r=[];for(let n of t.claim_sets)for(let i of n)e.has(i)||r.push(i);if(r.length>0)throw new sC({message:`Credential set contains undefined credential id${r.length===0?"":"`s"} '${r.join(", ")}'`})},"claimSetIdsAreDefined"),ap;(function(t){t.vModel=F({options:H(se(jt(wr)),G("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:H(Q(vr(),!0),G("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:H(Q(Ee([ie(),rt(),vt(ie(),rr())])),G("OPTIONAL. A string, number or object specifying the purpose of the query."))})})(ap||(ap={}));var cp;(function(t){let e=Ee([_a.vModel.entries.namespaces,xa.vModel.entries.claims,Aa.vModel.entries.claims]),r=t.vClaimsEntrySuccessResult=F({success:he(!0),claim_index:rt(),claim_id:Q(wr),output:e}),n=t.vClaimsEntryFailureResult=F({success:he(!1),claim_index:rt(),claim_id:Q(wr),issues:vt(ie(),rr()),output:rr()}),i=t.vClaimSetSuccessResult=F({success:he(!0),claim_set_index:Ee([rt(),br()]),valid_claim_indexes:Q(se(rt())),failed_claim_indexes:Q(br()),output:e}),s=t.vClaimSetFailureResult=F({success:he(!1),claim_set_index:Ee([rt(),br()]),valid_claim_indexes:Q(se(rt())),failed_claim_indexes:se(rt()),issues:vt(ie(),rr())}),u=t.vClaimsSuccessResult=F({success:he(!0),valid_claims:Q(se(r)),failed_claims:Q(se(n)),valid_claim_sets:se(i),failed_claim_sets:Q(se(s))}),a=t.vClaimsFailureResult=F({success:he(!1),valid_claims:Q(se(r)),failed_claims:se(n),valid_claim_sets:Q(br()),failed_claim_sets:se(s)});t.vModel=Ee([u,a])})(cp||(cp={}));var fp;(function(t){let e=t.vMetaSuccessResult=F({success:he(!0),output:gn("credential_format",[op(xa.vModel,["credential_format","cryptographic_holder_binding","vct"]),op(_a.vModel,["credential_format","cryptographic_holder_binding","doctype"]),op(Aa.vModel,["credential_format","cryptographic_holder_binding","type"])])}),r=t.vMetaFailureResult=F({success:he(!1),issues:vt(ie(),rr()),output:rr()});t.vModel=Ee([e,r])})(fp||(fp={}));var dp;(function(t){let e=t.vTrustedAuthorityEntrySuccessResult=F({success:he(!0),trusted_authority_index:rt(),output:gn("type",up.vModel.options.map(s=>F({type:s.entries.type,value:s.entries.values.item})))}),r=t.vTrustedAuthorityEntryFailureResult=F({success:he(!1),trusted_authority_index:rt(),issues:vt(ie(),rr()),output:rr()}),n=t.vTrustedAuthoritySuccessResult=Ee([F({success:he(!0),valid_trusted_authority:Q(br()),failed_trusted_authorities:Q(br())}),F({success:he(!0),valid_trusted_authority:e,failed_trusted_authorities:Q(se(r))})]),i=t.vTrustedAuthorityFailureResult=F({success:he(!1),valid_trusted_authority:Q(br()),failed_trusted_authorities:se(r)});t.vModel=Ee([...n.options,i])})(dp||(dp={}));var _b;(function(t){let e=t.vCredentialQueryItemCredentialSuccessResult=F({success:he(!0),input_credential_index:rt(),trusted_authorities:dp.vTrustedAuthoritySuccessResult,claims:cp.vClaimsSuccessResult,meta:fp.vMetaSuccessResult}),r=t.vCredentialQueryItemCredentialFailureResult=F({success:he(!1),input_credential_index:rt(),trusted_authorities:dp.vModel,claims:cp.vModel,meta:fp.vModel}),n=t.vCredentialQueryItemResult=Ee([F({success:he(!0),credential_query_id:wr,valid_credentials:se(e),failed_credentials:Q(se(r))}),F({success:he(!1),credential_query_id:wr,valid_credentials:Q(br()),failed_credentials:Q(se(r))})]),i=t.vCredentialQueryResult=vt(wr,n);t.vModel=F({credentials:H(se(Hf.vModel),G("REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials.")),credential_matches:i,credential_sets:Q(H(se(F({...ap.vModel.entries,matching_options:Ee([br(),se(jt(ie()))])})),G("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:vr()})})(_b||(_b={}));var Tx;(function(t){let e=t.vModel=_x(_b.vModel,["credentials"]);t.parse=r=>$f(e,r),t.fromDcqlPresentation=(r,n)=>{let{dcqlQuery:i}=n,s=Object.entries(r).map(([a,c])=>{let d=i.credentials.find(p=>p.id===a);if(!d)throw new yb({message:`Query ${a} not found in the dcql query. Cannot validate presentation.`});if(Array.isArray(c)){if(c.length===0)throw new yb({message:`Query credential '${a}' is present in the presentations but the value is an empty array. Each entry must at least provide one presentation.`});if(!d.multiple&&c.length>1)throw new yb({message:`Query credential '${a}' 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 Dx(d,{presentation:!0,credentials:c?Array.isArray(c)?c:[c]:[]})}),u=i.credential_sets?.map(a=>{let c=a.options.filter(d=>d.every(p=>s.find(y=>y.credential_query_id===p)?.success));return{...a,matching_options:c.length>0?c:void 0}});return{can_be_satisfied:s.every(a=>a.success&&!a.failed_credentials)&&(u?u.every(a=>!a.required||a.matching_options):i.credentials.every(a=>s.find(c=>c.credential_query_id===a.id)?.success)),credential_sets:u,credential_matches:Object.fromEntries(s.map(a=>[a.credential_query_id,a]))}},t.validate=r=>{if(!r.can_be_satisfied)throw new aC({message:"Invalid Presentation record",cause:r});return r}})(Tx||(Tx={}));var xC=o((t,e)=>{let r=Object.fromEntries(t.credentials.map(s=>[s.id,Dx(s,e)])),n=t.credential_sets?.map(s=>{let u=s.options.filter(a=>a.every(c=>r[c].success));return{...s,matching_options:u.length>0?u:void 0}}),i=n?n.every(s=>!s.required||s.matching_options):t.credentials.every(({id:s})=>r[s].success===!0);return{...t,can_be_satisfied:i,credential_matches:r,credential_sets:n}},"runDcqlQuery"),mo;(function(t){let e=t.vModel=F({credentials:H(se(Hf.vModel),G("REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials.")),credential_sets:H(Q(se(ap.vModel)),G("OPTIONAL. A non-empty array of credential set queries that specifies additional constraints on which of the requested Verifiable Credentials to return."))});t.validate=r=>{AC(r),SC(r),r.credentials.forEach(Hf.validate)},t.query=(r,n)=>xC(r,{credentials:n,presentation:!1}),t.parse=r=>$f(e,r)})(mo||(mo={}));var AC=o(t=>{let e=t.credentials.map(n=>n.id),r=e.filter((n,i)=>e.indexOf(n)!==i);if(r.length>0)throw new uC({message:`Duplicate credential query ids found: ${r.join(", ")}`})},"validateUniqueCredentialQueryIds"),SC=o(t=>{if(!t.credential_sets)return;let e=new Set(t.credentials.map(n=>n.id)),r=[];for(let n of t.credential_sets)for(let i of n.options)for(let s of i)e.has(s)||r.push(s);if(r.length>0)throw new oC({message:`Credential set contains undefined credential id${r.length===1?"":"`s"} '${r.join(", ")}'`})},"validateCredentialSets");var ai=o(t=>{if(t===null||typeof t!="object"||Array.isArray(t))throw new te("invalid_dcql_query","dcql_query must be a JSON object");let e;try{e=mo.parse(t)}catch(r){throw new te("invalid_dcql_query",`dcql_query failed structural validation: ${Mx(r)}`,{cause:r})}try{mo.validate(e)}catch(r){throw new te("invalid_dcql_query",`dcql_query failed content validation: ${Mx(r)}`,{cause:r})}return e},"parseDcqlQuery"),Mx=o(t=>t instanceof Error?t.message:String(t),"describe");var Eb=class Eb extends Error{constructor(e,r,n){super(r),this.name="RequestObjectError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}};o(Eb,"RequestObjectError");var Z=Eb,lp=o(async t=>{let e=await kC(t),{header:r,claims:n}=CC(e),i=bt(n.client_id);if(!i)throw new Z("invalid_request_object","Request Object JWS payload is missing client_id");let s=bt(n.client_id_scheme)??t.urlClientIdScheme,{prefix:u,value:a}=ep(i,s);if(t.urlClientId&&t.urlClientId!==i)throw new Z("client_id_mismatch",`Outer URL client_id (${t.urlClientId}) does not match signed Request Object client_id (${i})`);if(t.unsafeSkipRequestObjectSignatureVerification)return Vx(i,u,n);switch(u){case"redirect_uri":throw new Z("unsupported_client_id_scheme","client-id prefix=redirect_uri does not permit signed Request Objects (OID4VP \xA75)");case"did":await EC({jws:e,header:r,clientId:a,opts:t});break;case"x509_san_dns":await TC({jws:e,header:r,clientId:a,opts:t});break;case"pre-registered":await NC({jws:e,header:r,clientId:a,opts:t});break;case"https":case"verifier_attestation":case"x509_hash":throw new Z("unsupported_client_id_scheme",`client-id prefix=${u} is not yet supported (supported: did, x509_san_dns, pre-registered)`);default:{let c=u;throw new Z("unsupported_client_id_scheme",`client-id prefix=${c} is not supported`)}}return Vx(i,u,n)},"verifyAndDecodeRequestObject"),kC=o(async t=>{if(t.inlineJwt){if(!Lx(t.inlineJwt))throw new Z("invalid_request_object","Inline `request` parameter is not a compact JWS");return t.inlineJwt}if(!t.requestUri)throw new Z("invalid_request_object","verifyAndDecodeRequestObject requires either inlineJwt or requestUri");let e=t.fetchImpl??globalThis.fetch;if(typeof e!="function")throw new Z("request_fetch_failed","No fetch implementation available to resolve request_uri");let r;try{r=await e(t.requestUri,{method:"GET"})}catch(i){throw new Z("request_fetch_failed",`Failed to fetch request_uri: ${$t(i)}`,{cause:i})}if(!r.ok)throw new Z("request_fetch_failed",`request_uri returned ${r.status} ${r.statusText}`);let n=(await r.text()).trim();if(!Lx(n))throw new Z("invalid_request_object","request_uri response is not a compact JWS");return n},"loadJws"),CC=o(t=>{let[e,r]=t.split(".");try{let n=JSON.parse(Wx(e)),i=JSON.parse(Wx(r));return{header:n,claims:i}}catch(n){throw new Z("invalid_request_object",`Failed to decode Request Object JWS: ${$t(n)}`,{cause:n})}},"decodeHeaderAndClaims"),EC=o(async t=>{let{jws:e,header:r,clientId:n,opts:i}=t,s=bt(r.kid);if(!s)throw new Z("invalid_request_object","Request Object JWS header is missing kid (required for client_id_scheme=did)");let u=n.split("#")[0],a=i.didResolver??Cb(i.fetchImpl),c;try{c=await a(u)}catch(v){throw new Z("did_resolution_failed",`Failed to resolve ${u}: ${$t(v)}`,{cause:v})}let d=PC(c,s);if(!d)throw new Z("request_signer_untrusted",`Verification method ${s} not found on ${u}`);if(!d.publicKeyJwk)throw new Z("request_signer_untrusted",`Verification method ${d.id} has no publicKeyJwk (publicKeyMultibase not supported by default resolver)`);let p=bt(r.alg);if(!p)throw new Z("invalid_request_object","Request Object JWS header is missing alg");let y;try{y=await Xr(d.publicKeyJwk,p)}catch(v){throw new Z("request_signer_untrusted",`Failed to import publicKeyJwk from ${d.id}: ${$t(v)}`,{cause:v})}try{await za(e,y)}catch(v){throw new Z("request_signature_invalid",`JWS signature verification failed: ${$t(v)}`,{cause:v})}},"verifyWithDid"),PC=o((t,e)=>{let r=[];for(let i of t.verificationMethod??[])r.push(i);for(let i of t.authentication??[])typeof i=="object"&&r.push(i);for(let i of t.assertionMethod??[])typeof i=="object"&&r.push(i);let n=e.includes("#")?e.split("#").pop():e;return r.find(i=>i.id===e||i.id.split("#").pop()===n)},"findVerificationMethod"),TC=o(async t=>{let{jws:e,header:r,clientId:n,opts:i}=t,s=r.x5c;if(!Array.isArray(s)||s.length===0)throw new Z("invalid_request_object","Request Object JWS header is missing x5c (required for client_id_scheme=x509_san_dns)");let u;try{u=IC(s)}catch(x){throw new Z("invalid_request_object",`Failed to parse x5c chain: ${$t(x)}`,{cause:x})}let a=u[0],c=BC(n);if(!RC(a,c))throw new Z("client_id_mismatch",`Leaf certificate SAN does not cover client_id host "${c}" (sanDnsNames=${Fx(a).join(",")||"none"})`);let d=i.trustedX509Roots??[],p=!!i.unsafeAllowSelfSigned;if(d.length===0&&!p)throw new Z("request_signer_untrusted","client_id_scheme=x509_san_dns requires trustedX509Roots (or unsafeAllowSelfSigned for dev)");d.length>0&&await OC(u,d);let y=kb(s[0]),v;try{v=await pd(y,bt(r.alg)??"RS256")}catch(x){throw new Z("request_signer_untrusted",`Failed to import leaf X.509 cert: ${$t(x)}`,{cause:x})}try{await za(e,v)}catch(x){throw new Z("request_signature_invalid",`JWS signature verification failed: ${$t(x)}`,{cause:x})}},"verifyWithX509"),IC=o(t=>t.map(e=>new ca(kb(e))),"buildCertChain"),OC=o(async(t,e)=>{let r=e.map(i=>new ca(i));for(let i=0;i<t.length-1;i++){let s=t[i],u=t[i+1];if(!await Ux(s,u))throw new Z("request_signer_untrusted",`x5c chain broken at position ${i}: cert is not signed by its successor`)}let n=t[t.length-1];if(t.length===1){let i=await $x(n);for(let s of r)if(await $x(s)===i)return;throw new Z("request_signer_untrusted","Leaf certificate is self-contained and does not match any trustedX509Roots")}for(let i of r)if(await Ux(n,i))return;throw new Z("request_signer_untrusted","Top of x5c chain is not rooted in any trustedX509Roots")},"verifyChainToTrustedRoots"),Ux=o(async(t,e)=>{try{return await t.verify({publicKey:e.publicKey})}catch{return!1}},"safeVerify"),$x=o(async t=>{let e=await t.getThumbprint("SHA-256"),r=new Uint8Array(e),n="";for(let i=0;i<r.length;i++)n+=r[i].toString(16).padStart(2,"0");return n},"fingerprintHex"),RC=o((t,e)=>{let r=e.toLowerCase();for(let n of Fx(t))if(jC(n,r))return!0;return!1},"leafCoversHost"),Fx=o(t=>{let e=t.getExtension(sa);return e?e.names.toJSON().filter(r=>r.type==="dns").map(r=>r.value):[]},"listLeafSanDnsNames"),jC=o((t,e)=>{let r=t.toLowerCase();if(r===e)return!0;if(!r.startsWith("*."))return!1;let n=r.slice(1);if(!e.endsWith(n))return!1;let i=e.slice(0,-n.length);return i.length>0&&!i.includes(".")},"matchesDnsName");var kb=o(t=>{let e=t.replace(/\s+/g,"");return`-----BEGIN CERTIFICATE-----
|
|
21
|
+
`)}o(BC,"composeErrorMessage");function gv(t,e,r){var n=Ou(t.toString().match(/constructor\(([\w, ]+)\)/)||[],2),i=n[1],s=i===void 0?null:i,u=NC(s,e);return BC("Cannot inject the dependency "+u+' of "'+t.name+'" constructor. Reason:',r)}o(gv,"formatErrorCtor");function H2(t){if(typeof t.dispose!="function")return!1;var e=t.dispose;return!(e.length>0)}o(H2,"isDisposable");var DC=(function(t){mf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return o(e,"PreResolutionInterceptors"),e})(bf);var qC=(function(t){mf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return o(e,"PostResolutionInterceptors"),e})(bf);var MC=(function(){function t(){this.preResolution=new DC,this.postResolution=new qC}return o(t,"Interceptors"),t})(),W2=MC;var vv=new Map,UC=(function(){function t(e){this.parent=e,this._registry=new L2,this.interceptors=new W2,this.disposed=!1,this.disposables=new Set}return o(t,"InternalDependencyContainer"),t.prototype.register=function(e,r,n){n===void 0&&(n={lifecycle:dt.Transient}),this.ensureNotDisposed();var i;if(V2(r)?i=r:i={useClass:r},bo(i))for(var s=[e],u=i;u!=null;){var a=u.useToken;if(s.includes(a))throw new Error("Token registration cycle detected! "+Qr(s,[a]).join(" -> "));s.push(a);var c=this._registry.get(a);c&&bo(c.provider)?u=c.provider:u=null}if((n.lifecycle===dt.Singleton||n.lifecycle==dt.ContainerScoped||n.lifecycle==dt.ResolutionScoped)&&(wo(i)||Ru(i)))throw new Error('Cannot use lifecycle "'+dt[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:i,options:n}),this},t.prototype.registerType=function(e,r){return this.ensureNotDisposed(),Si(r)?this.register(e,{useToken:r}):this.register(e,{useClass:r})},t.prototype.registerInstance=function(e,r){return this.ensureNotDisposed(),this.register(e,{useValue:r})},t.prototype.registerSingleton=function(e,r){if(this.ensureNotDisposed(),Si(e)){if(Si(r))return this.register(e,{useToken:r},{lifecycle:dt.Singleton});if(r)return this.register(e,{useClass:r},{lifecycle:dt.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=e;return r&&!Si(r)&&(n=r),this.register(e,{useClass:n},{lifecycle:dt.Singleton})},t.prototype.resolve=function(e,r,n){r===void 0&&(r=new wf),n===void 0&&(n=!1),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&Si(e)){if(n)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),i){var s=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(e,s,"Single"),s}if($2(e)){var s=this.construct(e,r);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},t.prototype.executePreResolutionInterceptor=function(e,r){var n,i;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var u=gf(this.interceptors.preResolution.getAll(e)),a=u.next();!a.done;a=u.next()){var c=a.value;c.options.frequency!="Once"&&s.push(c),c.callback(e,r)}}catch(d){n={error:d}}finally{try{a&&!a.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(e,s)}},t.prototype.executePostResolutionInterceptor=function(e,r,n){var i,s;if(this.interceptors.postResolution.has(e)){var u=[];try{for(var a=gf(this.interceptors.postResolution.getAll(e)),c=a.next();!c.done;c=a.next()){var d=c.value;d.options.frequency!="Once"&&u.push(d),d.callback(e,r,n)}}catch(h){i={error:h}}finally{try{c&&!c.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}this.interceptors.postResolution.setAll(e,u)}},t.prototype.resolveRegistration=function(e,r){if(this.ensureNotDisposed(),e.options.lifecycle===dt.ResolutionScoped&&r.scopedResolutions.has(e))return r.scopedResolutions.get(e);var n=e.options.lifecycle===dt.Singleton,i=e.options.lifecycle===dt.ContainerScoped,s=n||i,u;return wo(e.provider)?u=e.provider.useValue:bo(e.provider)?u=s?e.instance||(e.instance=this.resolve(e.provider.useToken,r)):this.resolve(e.provider.useToken,r):vf(e.provider)?u=s?e.instance||(e.instance=this.construct(e.provider.useClass,r)):this.construct(e.provider.useClass,r):Ru(e.provider)?u=e.provider.useFactory(this):u=this.construct(e.provider,r),e.options.lifecycle===dt.ResolutionScoped&&r.scopedResolutions.set(e,u),u},t.prototype.resolveAll=function(e,r,n){var i=this;r===void 0&&(r=new wf),n===void 0&&(n=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&Si(e)){if(n)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var u=s.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(e,u,"All"),u}var a=[this.construct(e,r)];return this.executePostResolutionInterceptor(e,a,"All"),a},t.prototype.isRegistered=function(e,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(e)||r&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},t.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},t.prototype.clearInstances=function(){var e,r;this.ensureNotDisposed();try{for(var n=gf(this._registry.entries()),i=n.next();!i.done;i=n.next()){var s=Ou(i.value,2),u=s[0],a=s[1];this._registry.setAll(u,a.filter(function(c){return!wo(c.provider)}).map(function(c){return c.instance=void 0,c}))}}catch(c){e={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t.prototype.createChildContainer=function(){var e,r;this.ensureNotDisposed();var n=new t(this);try{for(var i=gf(this._registry.entries()),s=i.next();!s.done;s=i.next()){var u=Ou(s.value,2),a=u[0],c=u[1];c.some(function(d){var h=d.options;return h.lifecycle===dt.ContainerScoped})&&n._registry.setAll(a,c.map(function(d){return d.options.lifecycle===dt.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){e={error:d}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},t.prototype.beforeResolution=function(e,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:r,options:n})},t.prototype.afterResolution=function(e,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:r,options:n})},t.prototype.dispose=function(){return M2(this,void 0,void 0,function(){var e;return U2(this,function(r){switch(r.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 r.sent(),[2]}})})},t.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},t.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},t.prototype.construct=function(e,r){var n=this;if(e instanceof Hl)return e.createProxy(function(s){return n.resolve(s,r)});var i=(function(){var s=vv.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var u=s.map(n.resolveParams(r,e));return new(e.bind.apply(e,Qr([void 0],u)))})();return H2(i)&&this.disposables.add(i),i},t.prototype.resolveParams=function(e,r){var n=this;return function(i,s){var u,a,c;try{return mv(i)?Wl(i)?i.multiple?(u=n.resolve(i.transform)).transform.apply(u,Qr([n.resolveAll(i.token,new wf,i.isOptional)],i.transformArgs)):(a=n.resolve(i.transform)).transform.apply(a,Qr([n.resolve(i.token,e,i.isOptional)],i.transformArgs)):i.multiple?n.resolveAll(i.token,new wf,i.isOptional):n.resolve(i.token,e,i.isOptional):Wl(i)?(c=n.resolve(i.transform,e)).transform.apply(c,Qr([n.resolve(i.token,e)],i.transformArgs)):n.resolve(i,e)}catch(d){throw new Error(gv(r,s,d))}}},t.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},t})(),Ie=new UC;function $C(t){return function(e){vv.set(e,yv(e)),t&&t.token&&(Array.isArray(t.token)?t.token.forEach(function(r){Ie.register(r,e)}):Ie.register(t.token,e))}}o($C,"injectable");var ki=$C;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 wv,_v=class _v{constructor(e={}){l(this,"attrId","");l(this,"attrValues",[]);Object.assign(e)}};o(_v,"PKCS12Attribute");var _o=_v;f([p({type:m.ObjectIdentifier})],_o.prototype,"attrId",void 0);f([p({type:m.Any,repeated:"set"})],_o.prototype,"attrValues",void 0);var ju,F2=wv=(ju=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,wv.prototype)}},o(ju,"PKCS12AttrSet"),ju);F2=wv=f([w({type:v.Sequence,itemType:_o})],F2);var xv,Nu,z2=xv=(Nu=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,xv.prototype)}},o(Nu,"AuthenticatedSafe"),Nu);z2=xv=f([w({type:v.Sequence,itemType:mr})],z2);var VC="1.2.840.113549",LC=`${VC}.1`,K2=`${LC}.12`,Bu=`${K2}.1`,cQ=`${Bu}.1`,fQ=`${Bu}.2`,dQ=`${Bu}.3`,lQ=`${Bu}.4`,pQ=`${Bu}.5`,hQ=`${Bu}.6`,xo=`${K2}.10.1`;var gQ=`${xo}.1`,vQ=`${xo}.2`,bQ=`${xo}.3`,wQ=`${xo}.4`,_Q=`${xo}.5`,xQ=`${xo}.6`,Fl="1.2.840.113549.1.9";var Av=class Av{constructor(e={}){l(this,"certId","");l(this,"certValue",new ArrayBuffer(0));Object.assign(this,e)}};o(Av,"CertBag");var zl=Av;f([p({type:m.ObjectIdentifier})],zl.prototype,"certId",void 0);f([p({type:m.Any,context:0})],zl.prototype,"certValue",void 0);var J2=`${Fl}.22`,EQ=`${J2}.1`,PQ=`${J2}.2`;var Sv=class Sv{constructor(e={}){l(this,"crlId","");l(this,"crltValue",new ArrayBuffer(0));Object.assign(this,e)}};o(Sv,"CRLBag");var Kl=Sv;f([p({type:m.ObjectIdentifier})],Kl.prototype,"crlId",void 0);f([p({type:m.Any,context:0})],Kl.prototype,"crltValue",void 0);var HC=`${Fl}.23`,NQ=`${HC}.1`;var kv=class kv extends F{};o(kv,"EncryptedData");var Jl=kv,Cv=class Cv{constructor(e={}){l(this,"encryptionAlgorithm",new C);l(this,"encryptedData",new Jl);Object.assign(this,e)}};o(Cv,"EncryptedPrivateKeyInfo");var Ci=Cv;f([p({type:C})],Ci.prototype,"encryptionAlgorithm",void 0);f([p({type:Jl})],Ci.prototype,"encryptedData",void 0);var Ev,Pv;(function(t){t[t.v1=0]="v1"})(Pv||(Pv={}));var Iv=class Iv extends F{};o(Iv,"PrivateKey");var Gl=Iv,Du,Tv=Ev=(Du=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Ev.prototype)}},o(Du,"Attributes"),Du);Tv=Ev=f([w({type:v.Sequence,itemType:ct})],Tv);var Ov=class Ov{constructor(e={}){l(this,"version",Pv.v1);l(this,"privateKeyAlgorithm",new C);l(this,"privateKey",new Gl);l(this,"attributes");Object.assign(this,e)}};o(Ov,"PrivateKeyInfo");var Ei=Ov;f([p({type:m.Integer})],Ei.prototype,"version",void 0);f([p({type:C})],Ei.prototype,"privateKeyAlgorithm",void 0);f([p({type:Gl})],Ei.prototype,"privateKey",void 0);f([p({type:Tv,implicit:!0,context:0,optional:!0})],Ei.prototype,"attributes",void 0);var qu,G2=(qu=class extends Ei{},o(qu,"KeyBag"),qu);G2=f([w({type:v.Sequence})],G2);var Mu,X2=(Mu=class extends Ci{},o(Mu,"PKCS8ShroudedKeyBag"),Mu);X2=f([w({type:v.Sequence})],X2);var Rv=class Rv{constructor(e={}){l(this,"secretTypeId","");l(this,"secretValue",new ArrayBuffer(0));Object.assign(this,e)}};o(Rv,"SecretBag");var Xl=Rv;f([p({type:m.ObjectIdentifier})],Xl.prototype,"secretTypeId",void 0);f([p({type:m.Any,context:0})],Xl.prototype,"secretValue",void 0);var jv=class jv{constructor(e={}){l(this,"mac",new vo);l(this,"macSalt",new F);l(this,"iterations",1);Object.assign(this,e)}};o(jv,"MacData");var Pi=jv;f([p({type:vo})],Pi.prototype,"mac",void 0);f([p({type:F})],Pi.prototype,"macSalt",void 0);f([p({type:m.Integer,defaultValue:1})],Pi.prototype,"iterations",void 0);var Nv=class Nv{constructor(e={}){l(this,"version",3);l(this,"authSafe",new mr);l(this,"macData",new Pi);Object.assign(this,e)}};o(Nv,"PFX");var Ao=Nv;f([p({type:m.Integer})],Ao.prototype,"version",void 0);f([p({type:mr})],Ao.prototype,"authSafe",void 0);f([p({type:Pi,optional:!0})],Ao.prototype,"macData",void 0);var Bv,Dv=class Dv{constructor(e={}){l(this,"bagId","");l(this,"bagValue",new ArrayBuffer(0));l(this,"bagAttributes");Object.assign(this,e)}};o(Dv,"SafeBag");var $u=Dv;f([p({type:m.ObjectIdentifier})],$u.prototype,"bagId",void 0);f([p({type:m.Any,context:0})],$u.prototype,"bagValue",void 0);f([p({type:_o,repeated:"set",optional:!0})],$u.prototype,"bagAttributes",void 0);var Uu,Z2=Bv=(Uu=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Bv.prototype)}},o(Uu,"SafeContents"),Uu);Z2=Bv=f([w({type:v.Sequence,itemType:$u})],Z2);var qv,Mv,Uv,Ue="1.2.840.113549.1.9",VY=`${Ue}.0`,dx=`${Ue}.24`,xf=`${Ue}.25`,lx=`${Ue}.26`,px=`${Ue}.27`,LY=`${dx}.1`,HY=`${dx}.2`,WY=`${Ue}.1`,FY=`${Ue}.2`,zY=`${Ue}.3`,KY=`${Ue}.4`,JY=`${Ue}.5`,GY=`${Ue}.6`,Kv=`${Ue}.7`,XY=`${Ue}.8`,ZY=`${Ue}.9`,QY=`${Ue}.13`,Af=`${Ue}.14`,YY=`${Ue}.15`,eee=`${Ue}.20`,tee=`${Ue}.21`;var ree=`${xf}.1`,nee=`${xf}.2`,iee=`${xf}.3`,oee=`${xf}.4`,see=`${xf}.5`,Sf="1.3.6.1.5.5.7.9",uee=`${Sf}.1`,aee=`${Sf}.2`,cee=`${Sf}.3`,fee=`${Sf}.4`,dee=`${Sf}.5`,lee=`${lx}.1`,pee=`${lx}.2`,hee=`${px}.1`,yee=`${px}.2`,mee=`${Ue}.16`,gee=`${Ue}.22`,vee=`${Ue}.23`,bee=`${vg}.65`,Vu,Zl=(Vu=class extends Ke{constructor(r={}){super(r);l(this,"ia5String")}toString(){return{}.toString(),this.ia5String||super.toString()}},o(Vu,"PKCS9String"),Vu);f([p({type:m.IA5String})],Zl.prototype,"ia5String",void 0);Zl=f([w({type:v.Choice})],Zl);var Lu,Q2=(Lu=class extends mr{},o(Lu,"Pkcs7PDU"),Lu);Q2=f([w({type:v.Sequence})],Q2);var Hu,Y2=(Hu=class extends Ao{},o(Hu,"UserPKCS12"),Hu);Y2=f([w({type:v.Sequence})],Y2);var Wu,ex=(Wu=class extends Ci{},o(Wu,"EncryptedPrivateKeyInfo"),Wu);ex=f([w({type:v.Sequence})],ex);var Fu,$v=(Fu=class{constructor(e=""){l(this,"value");this.value=e}toString(){return this.value}},o(Fu,"EmailAddress"),Fu);f([p({type:m.IA5String})],$v.prototype,"value",void 0);$v=f([w({type:v.Choice})],$v);var zu,tx=(zu=class extends Zl{},o(zu,"UnstructuredName"),zu);tx=f([w({type:v.Choice})],tx);var Ku,rx=(Ku=class extends Ke{},o(Ku,"UnstructuredAddress"),Ku);rx=f([w({type:v.Choice})],rx);var Ju,Vv=(Ju=class{constructor(e=new Date){l(this,"value");this.value=e}},o(Ju,"DateOfBirth"),Ju);f([p({type:m.GeneralizedTime})],Vv.prototype,"value",void 0);Vv=f([w({type:v.Choice})],Vv);var Gu,nx=(Gu=class extends Ke{},o(Gu,"PlaceOfBirth"),Gu);nx=f([w({type:v.Choice})],nx);var Xu,Lv=(Xu=class{constructor(e="M"){l(this,"value");this.value=e}toString(){return this.value}},o(Xu,"Gender"),Xu);f([p({type:m.PrintableString})],Lv.prototype,"value",void 0);Lv=f([w({type:v.Choice})],Lv);var Zu,Ql=(Zu=class{constructor(e=""){l(this,"value");this.value=e}toString(){return this.value}},o(Zu,"CountryOfCitizenship"),Zu);f([p({type:m.PrintableString})],Ql.prototype,"value",void 0);Ql=f([w({type:v.Choice})],Ql);var Qu,ix=(Qu=class extends Ql{},o(Qu,"CountryOfResidence"),Qu);ix=f([w({type:v.Choice})],ix);var Yu,ox=(Yu=class extends Ke{},o(Yu,"Pseudonym"),Yu);ox=f([w({type:v.Choice})],ox);var ea,Hv=(ea=class{constructor(e=""){l(this,"value");this.value=e}toString(){return this.value}},o(ea,"ContentType"),ea);f([p({type:m.ObjectIdentifier})],Hv.prototype,"value",void 0);Hv=f([w({type:v.Choice})],Hv);var ta,sx=(ta=class extends Me{},o(ta,"SigningTime"),ta);sx=f([w({type:v.Choice})],sx);var ra,Wv=(ra=class{constructor(e=0){l(this,"value");this.value=e}toString(){return this.value.toString()}},o(ra,"SequenceNumber"),ra);f([p({type:m.Integer})],Wv.prototype,"value",void 0);Wv=f([w({type:v.Choice})],Wv);var na,ux=(na=class extends Mt{},o(na,"CounterSignature"),na);ux=f([w({type:v.Sequence})],ux);var ia,_f=(ia=class extends Ke{},o(ia,"ChallengePassword"),ia);_f=f([w({type:v.Choice})],_f);var oa,ax=qv=(oa=class extends pr{constructor(e){super(e),Object.setPrototypeOf(this,qv.prototype)}},o(oa,"ExtensionRequest"),oa);ax=qv=f([w({type:v.Sequence})],ax);var sa,cx=Mv=(sa=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Mv.prototype)}},o(sa,"ExtendedCertificateAttributes"),sa);cx=Mv=f([w({type:v.Set,itemType:Rr})],cx);var ua,Fv=(ua=class{constructor(e=""){l(this,"value");this.value=e}toString(){return this.value}},o(ua,"FriendlyName"),ua);f([p({type:m.BmpString})],Fv.prototype,"value",void 0);Fv=f([w({type:v.Choice})],Fv);var aa,zv=(aa=class extends C{},o(aa,"SMIMECapability"),aa);zv=f([w({type:v.Sequence})],zv);var ca,fx=Uv=(ca=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Uv.prototype)}},o(ca,"SMIMECapabilities"),ca);fx=Uv=f([w({type:v.Sequence,itemType:zv})],fx);var Jv,fa,kf=Jv=(fa=class extends ${constructor(e){super(e),Object.setPrototypeOf(this,Jv.prototype)}},o(fa,"Attributes"),fa);kf=Jv=f([w({type:v.Sequence,itemType:ct})],kf);var Gv=class Gv{constructor(e={}){l(this,"version",0);l(this,"subject",new Ae);l(this,"subjectPKInfo",new ht);l(this,"attributes",new kf);Object.assign(this,e)}};o(Gv,"CertificationRequestInfo");var Yr=Gv;f([p({type:m.Integer})],Yr.prototype,"version",void 0);f([p({type:Ae})],Yr.prototype,"subject",void 0);f([p({type:ht})],Yr.prototype,"subjectPKInfo",void 0);f([p({type:kf,implicit:!0,context:0,optional:!0})],Yr.prototype,"attributes",void 0);var Xv=class Xv{constructor(e={}){l(this,"certificationRequestInfo",new Yr);l(this,"certificationRequestInfoRaw");l(this,"signatureAlgorithm",new C);l(this,"signature",new ArrayBuffer(0));Object.assign(this,e)}};o(Xv,"CertificationRequest");var Ti=Xv;f([p({type:Yr,raw:!0})],Ti.prototype,"certificationRequestInfo",void 0);f([p({type:C})],Ti.prototype,"signatureAlgorithm",void 0);f([p({type:m.BitString})],Ti.prototype,"signature",void 0);var Zf="crypto.algorithm",pb=class pb{getAlgorithms(){return Ie.resolveAll(Zf)}toAsnAlgorithm(e){({...e});for(let r of this.getAlgorithms()){let n=r.toAsnAlgorithm(e);if(n)return n}if(/^[0-9.]+$/.test(e.name)){let r=new C({algorithm:e.name});if("parameters"in e){let n=e;r.parameters=n.parameters}return r}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}}};o(pb,"AlgorithmProvider");var sb=pb,ba="crypto.algorithmProvider";Ie.registerSingleton(ba,sb);var rp,Lt="1.3.36.3.3.2.8.1.1",hx=`${Lt}.1`,yx=`${Lt}.2`,mx=`${Lt}.3`,gx=`${Lt}.4`,vx=`${Lt}.5`,bx=`${Lt}.6`,wx=`${Lt}.7`,_x=`${Lt}.8`,xx=`${Lt}.9`,Ax=`${Lt}.10`,Sx=`${Lt}.11`,kx=`${Lt}.12`,Cx=`${Lt}.13`,Ex=`${Lt}.14`,Px="brainpoolP160r1",Tx="brainpoolP160t1",Ix="brainpoolP192r1",Ox="brainpoolP192t1",Rx="brainpoolP224r1",jx="brainpoolP224t1",Nx="brainpoolP256r1",Bx="brainpoolP256t1",Dx="brainpoolP320r1",qx="brainpoolP320t1",Mx="brainpoolP384r1",Ux="brainpoolP384t1",$x="brainpoolP512r1",Vx="brainpoolP512t1",Oe="ECDSA",ya,Kf=rp=(ya=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case Oe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return k2;case"sha-256":return C2;case"sha-384":return E2;case"sha-512":return P2}else if("namedCurve"in e){let r="";switch(e.namedCurve){case"P-256":r=Gg;break;case"K-256":r=rp.SECP256K1;break;case"P-384":r=Xg;break;case"P-521":r=Zg;break;case Px:r=hx;break;case Tx:r=yx;break;case Ix:r=mx;break;case Ox:r=gx;break;case Rx:r=vx;break;case jx:r=bx;break;case Nx:r=wx;break;case Bx:r=_x;break;case Dx:r=xx;break;case qx:r=Ax;break;case Mx:r=Sx;break;case Ux:r=kx;break;case $x:r=Cx;break;case Vx:r=Ex;break}if(r)return new C({algorithm:lo,parameters:j.serialize(new Gr({namedCurve:r}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case ff:return{name:Oe,hash:{name:"SHA-1"}};case df:return{name:Oe,hash:{name:"SHA-256"}};case lf:return{name:Oe,hash:{name:"SHA-384"}};case pf:return{name:Oe,hash:{name:"SHA-512"}};case lo:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(j.parse(e.parameters,Gr).namedCurve){case Gg:return{name:Oe,namedCurve:"P-256"};case rp.SECP256K1:return{name:Oe,namedCurve:"K-256"};case Xg:return{name:Oe,namedCurve:"P-384"};case Zg:return{name:Oe,namedCurve:"P-521"};case hx:return{name:Oe,namedCurve:Px};case yx:return{name:Oe,namedCurve:Tx};case mx:return{name:Oe,namedCurve:Ix};case gx:return{name:Oe,namedCurve:Ox};case vx:return{name:Oe,namedCurve:Rx};case bx:return{name:Oe,namedCurve:jx};case wx:return{name:Oe,namedCurve:Nx};case _x:return{name:Oe,namedCurve:Bx};case xx:return{name:Oe,namedCurve:Dx};case Ax:return{name:Oe,namedCurve:qx};case Sx:return{name:Oe,namedCurve:Mx};case kx:return{name:Oe,namedCurve:Ux};case Cx:return{name:Oe,namedCurve:$x};case Ex:return{name:Oe,namedCurve:Vx}}}}return null}},o(ya,"EcAlgorithm"),ya);Kf.SECP256K1="1.3.132.0.10";Kf=rp=f([ki()],Kf);Ie.registerSingleton(Zf,Kf);var Qx=Symbol("name"),Yx=Symbol("value"),hb=class hb{constructor(e,r={},n=""){this[Qx]=e,this[Yx]=n;for(let i in r)this[i]=r[i]}};o(hb,"TextObject");var fe=hb;fe.NAME=Qx;fe.VALUE=Yx;var yb=class yb{static toTextObject(e){let r=new fe("Algorithm Identifier",{},tn.toString(e.algorithm));if(e.parameters)if(e.algorithm===lo){let n=new Kf().toWebAlgorithm(e);n&&"namedCurve"in n?r["Named Curve"]=n.namedCurve:r.Parameters=e.parameters}else r.Parameters=e.parameters;return r}};o(yb,"DefaultAlgorithmSerializer");var ub=yb,mb=class mb{static toString(e){let r=this.items[e];return r||e}};o(mb,"OidSerializer");var tn=mb;tn.items={[ho]:"sha1",[$l]:"sha224",[yo]:"sha256",[mo]:"sha384",[go]:"sha512",[Xr]:"rsaEncryption",[Su]:"sha1WithRSAEncryption",[j2]:"sha224WithRSAEncryption",[Ul]:"sha256WithRSAEncryption",[ku]:"sha384WithRSAEncryption",[Cu]:"sha512WithRSAEncryption",[lo]:"ecPublicKey",[ff]:"ecdsaWithSHA1",[Ml]:"ecdsaWithSHA224",[df]:"ecdsaWithSHA256",[lf]:"ecdsaWithSHA384",[pf]:"ecdsaWithSHA512",[s2]:"TLS WWW server authentication",[u2]:"TLS WWW client authentication",[a2]:"Code Signing",[c2]:"E-mail Protection",[f2]:"Time Stamping",[d2]:"OCSP Signing",[A2]:"Signed Data"};var gb=class gb{static serialize(e){return this.serializeObj(e).join(`
|
|
22
|
+
`)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,r=0){let n=[],i=this.pad(r++),s="",u=e[fe.VALUE];u&&(s=` ${u}`),n.push(`${i}${e[fe.NAME]}:${s}`),i=this.pad(r);for(let a in e){if(typeof a=="symbol")continue;let c=e[a],d=a?`${a}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")n.push(`${i}${d}${c}`);else if(c instanceof Date)n.push(`${i}${d}${c.toUTCString()}`);else if(Array.isArray(c))for(let h of c)h[fe.NAME]=a,n.push(...this.serializeObj(h,r));else if(c instanceof fe)c[fe.NAME]=a,n.push(...this.serializeObj(c,r));else if(E.BufferSourceConverter.isBufferSource(c))a?(n.push(`${i}${d}`),n.push(...this.serializeBufferSource(c,r+1))):n.push(...this.serializeBufferSource(c,r));else if("toTextObject"in c){let h=c.toTextObject();h[fe.NAME]=a,n.push(...this.serializeObj(h,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return n}static serializeBufferSource(e,r=0){let n=this.pad(r),i=E.BufferSourceConverter.toUint8Array(e),s=[];for(let u=0;u<i.length;){let a=[];for(let c=0;c<16&&u<i.length;c++){c===8&&a.push("");let d=i[u++].toString(16).padStart(2,"0");a.push(d)}s.push(`${n}${a.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}};o(gb,"TextConverter");var Un=gb;Un.oidSerializer=tn;Un.algorithmSerializer=ub;var da,yp=class yp{get rawData(){return Z(this,da,"f")||Ce(this,da,j.serialize(this.asn),"f"),Z(this,da,"f")}constructor(...e){da.set(this,void 0),E.BufferSourceConverter.isBufferSource(e[0])?(this.asn=j.parse(e[0],e[1]),Ce(this,da,E.BufferSourceConverter.toArrayBuffer(e[0]),"f"),this.onInit(this.asn)):(this.asn=e[0],this.onInit(this.asn))}equal(e){return e instanceof yp?(0,E.isEqual)(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return j.toString(this.rawData);case"text":return Un.serialize(this.toTextObject());case"hex":return E.Convert.ToHex(this.rawData);case"base64":return E.Convert.ToBase64(this.rawData);case"base64url":return E.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 fe(this.getTextName(),{},e)}};o(yp,"AsnData");var Oi=yp;da=new WeakMap;Oi.NAME="ASN";var mp=class mp extends Oi{constructor(...e){let r;E.BufferSourceConverter.isBufferSource(e[0])?r=E.BufferSourceConverter.toArrayBuffer(e[0]):r=j.serialize(new xt({extnID:e[0],critical:e[1],extnValue:new Hi(E.BufferSourceConverter.toArrayBuffer(e[2]))})),super(r,xt)}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[fe.NAME]===mp.NAME&&(e[fe.NAME]=tn.toString(this.type)),e}};o(mp,"Extension");var Xt=mp,eA,So=class So{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[eA]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(So.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(So.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,r){return this.items.forEach(e,r)}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=So.DEFAULT){let r=this.items.get(e.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${e}'`);return r}set(e,r){if(typeof e=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),r)}else this.items.set(So.DEFAULT,e);return this}};o(So,"CryptoProvider");var Jf=So;eA=Symbol.toStringTag;Jf.DEFAULT="default";var At=new Jf,KC=/^[0-2](?:\.[1-9][0-9]*)+$/;function JC(t){return new RegExp(KC).test(t)}o(JC,"isOID");var vb=class vb{constructor(e={}){this.items={};for(let r in e)this.register(r,e[r])}get(e){return this.items[e]||null}findId(e){return JC(e)?e:this.get(e)}register(e,r){this.items[e]=r,this.items[r]=e}};o(vb,"NameIdentifier");var ip=vb,Vt=new ip;Vt.register("CN","2.5.4.3");Vt.register("L","2.5.4.7");Vt.register("ST","2.5.4.8");Vt.register("O","2.5.4.10");Vt.register("OU","2.5.4.11");Vt.register("C","2.5.4.6");Vt.register("DC","0.9.2342.19200300.100.1.25");Vt.register("E","1.2.840.113549.1.9.1");Vt.register("G","2.5.4.42");Vt.register("I","2.5.4.43");Vt.register("SN","2.5.4.4");Vt.register("T","2.5.4.12");function GC(t,e){return`\\${E.Convert.ToHex(E.Convert.FromUtf8String(e)).toUpperCase()}`}o(GC,"replaceUnknownCharacter");function XC(t){return t.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,GC)}o(XC,"escape");var gp=class gp{static isASCII(e){for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,r={}){this.extraNames=new ip,this.asn=new Ae;for(let n in r)if(Object.prototype.hasOwnProperty.call(r,n)){let i=r[n];this.extraNames.register(n,i)}typeof e=="string"?this.asn=this.fromString(e):e instanceof Ae?this.asn=e:E.BufferSourceConverter.isBufferSource(e)?this.asn=j.parse(e,Ae):this.asn=this.fromJSON(e)}getField(e){let r=this.extraNames.findId(e)||Vt.findId(e),n=[];for(let i of this.asn)for(let s of i)s.type===r&&n.push(s.value.toString());return n}getName(e){return this.extraNames.get(e)||Vt.get(e)}toString(){return this.asn.map(e=>e.map(r=>{let n=this.getName(r.type)||r.type,i=r.value.anyValue?`#${E.Convert.ToHex(r.value.anyValue)}`:XC(r.value.toString());return`${n}=${i}`}).join("+")).join(", ")}toJSON(){var e;let r=[];for(let n of this.asn){let i={};for(let s of n){let u=this.getName(s.type)||s.type;(e=i[u])!==null&&e!==void 0||(i[u]=[]),i[u].push(s.value.anyValue?`#${E.Convert.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(i)}return r}fromString(e){let r=new Ae,n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g,i=null,s=",";for(;i=n.exec(`${e},`);){let[,u,a]=i,c=a[a.length-1];(c===","||c==="+")&&(a=a.slice(0,a.length-1),i[3]=c);let d=i[3];u=this.getTypeOid(u);let h=this.createAttribute(u,a);s==="+"?r[r.length-1].push(h):r.push(new ci([h])),s=d}return r}fromJSON(e){let r=new Ae;for(let n of e){let i=new ci;for(let s in n){let u=this.getTypeOid(s),a=n[s];for(let c of a){let d=this.createAttribute(u,c);i.push(d)}}r.push(i)}return r}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,r){let n=new Fi({type:e});if(typeof r=="object")for(let i in r)switch(i){case"ia5String":n.value.ia5String=r[i];break;case"utf8String":n.value.utf8String=r[i];break;case"universalString":n.value.universalString=r[i];break;case"bmpString":n.value.bmpString=r[i];break;case"printableString":n.value.printableString=r[i];break}else if(r[0]==="#")n.value.anyValue=E.Convert.FromHex(r.slice(1));else{let i=this.processStringValue(r);e===this.getName("E")||e===this.getName("DC")?n.value.ia5String=i:gp.isPrintableString(i)?n.value.printableString=i:n.value.utf8String=i}return n}processStringValue(e){let r=/"(.*?[^\\])?"/.exec(e);return r&&(e=r[1]),e.replace(/\\0a/ig,`
|
|
23
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return j.serialize(this.asn)}async getThumbprint(...e){var r;let n,i="SHA-1";return e.length>=1&&!(!((r=e[0])===null||r===void 0)&&r.subtle)?(i=e[0]||i,n=e[1]||At.get()):n=e[0]||At.get(),await n.subtle.digest(i,this.toArrayBuffer())}};o(gp,"Name");var Co=gp,tA="Cannot initialize GeneralName from ASN.1 data.",Lx=`${tA} Unsupported string format in use.`,ZC=`${tA} Value doesn't match to GUID regular expression.`,Hx=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Wx="1.3.6.1.4.1.311.25.1",Fx="1.3.6.1.4.1.311.20.2.3",Zv="dns",Qv="dn",Yv="email",eb="ip",tb="url",rb="guid",nb="upn",Yl="id",bb=class bb extends Oi{constructor(...e){let r;if(e.length===2)switch(e[0]){case Qv:{let n=new Co(e[1]).toArrayBuffer(),i=j.parse(n,Ae);r=new W({directoryName:i});break}case Zv:r=new W({dNSName:e[1]});break;case Yv:r=new W({rfc822Name:e[1]});break;case rb:{let n=new RegExp(Hx,"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((s,u)=>u<3?E.Convert.ToHex(new Uint8Array(E.Convert.FromHex(s)).reverse()):s).join("");r=new W({otherName:new fi({typeId:Wx,value:j.serialize(new Hi(E.Convert.FromHex(i)))})});break}case eb:r=new W({iPAddress:e[1]});break;case Yl:r=new W({registeredID:e[1]});break;case nb:{r=new W({otherName:new fi({typeId:Fx,value:j.serialize(Pm.toASN(e[1]))})});break}case tb:r=new W({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else E.BufferSourceConverter.isBufferSource(e[0])?r=j.parse(e[0],W):r=e[0];super(r)}onInit(e){if(e.dNSName!=null)this.type=Zv,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=Yv,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=eb,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=tb,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Yl,this.value=e.registeredID;else if(e.directoryName!=null)this.type=Qv,this.value=new Co(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===Wx){this.type=rb;let r=j.parse(e.otherName.value,Hi),n=new RegExp(Hx,"i").exec(E.Convert.ToHex(r));if(!n)throw new Error(ZC);this.value=n.slice(1).map((i,s)=>s<3?E.Convert.ToHex(new Uint8Array(E.Convert.FromHex(i)).reverse()):i).join("-")}else if(e.otherName.typeId===Fx)this.type=nb,this.value=j.parse(e.otherName.value,Ke).toString();else throw new Error(Lx);else throw new Error(Lx)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case Qv:case Zv:case rb:case eb:case Yl:case nb:case tb:e=this.type.toUpperCase();break;case Yv:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===Yl&&(r=tn.toString(r)),new fe(e,void 0,r)}};o(bb,"GeneralName");var en=bb,wb=class wb extends Oi{constructor(e){let r;if(e instanceof Ee)r=e;else if(Array.isArray(e)){let n=[];for(let i of e)if(i instanceof W)n.push(i);else{let s=j.parse(new en(i.type,i.value).rawData,W);n.push(s)}r=new Ee(n)}else if(E.BufferSourceConverter.isBufferSource(e))r=j.parse(e,Ee);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(e){let r=[];for(let n of e){let i=null;try{i=new en(n)}catch{continue}r.push(i)}this.items=r}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){let e=super.toTextObjectEmpty();for(let r of this.items){let n=r.toTextObject(),i=e[n[fe.NAME]];Array.isArray(i)||(i=[],e[n[fe.NAME]]=i),i.push(n)}return e}};o(wb,"GeneralNames");var $n=wb;$n.NAME="GeneralNames";var Wf="-{5}",Gf="\\n",QC=`[^${Gf}]+`,YC=`${Wf}BEGIN (${QC}(?=${Wf}))${Wf}`,e8=`${Wf}END \\1${Wf}`,wa="\\n",t8=`[^:${Gf}]+`,r8=`(?:[^${Gf}]+${wa}(?: +[^${Gf}]+${wa})*)`,n8="[a-zA-Z0-9=+/]+",i8=`(?:${n8}${wa})+`,zx=`${YC}${wa}(?:((?:${t8}: ${r8})+))?${wa}?(${i8})${e8}`,_b=class _b{static isPem(e){return typeof e=="string"&&new RegExp(zx,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");let r=new RegExp(zx,"g"),n=[],i=null;for(;i=r.exec(e);){let s=i[3].replace(new RegExp(`[${Gf}]+`,"g"),""),u={type:i[1],headers:[],rawData:E.Convert.FromBase64(s)},a=i[2];if(a){let c=a.split(new RegExp(wa,"g")),d=null;for(let h of c){let[y,b]=h.split(/:(.*)/);if(b===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=y.trim()}else d&&u.headers.push(d),d={key:y,value:b.trim()}}d&&u.headers.push(d)}n.push(u)}return n}static decode(e){return this.decodeWithHeaders(e).map(n=>n.rawData)}static decodeFirst(e){let r=this.decode(e);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(e,r){if(Array.isArray(e)){let n=new Array;return r?e.forEach(i=>{if(!E.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:r,rawData:E.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(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:E.BufferSourceConverter.toArrayBuffer(e)})}}static encodeStruct(e){var r;let n=e.type.toLocaleUpperCase(),i=[];if(i.push(`-----BEGIN ${n}-----`),!((r=e.headers)===null||r===void 0)&&r.length){for(let d of e.headers)i.push(`${d.key}: ${d.value}`);i.push("")}let s=E.Convert.ToBase64(e.rawData),u,a=0,c=Array();for(;a<s.length&&(s.length-a<64?u=s.substring(a):(u=s.substring(a,a+64),a+=64),u.length!==0);)if(c.push(u),u.length<64)break;return i.push(...c),i.push(`-----END ${n}-----`),i.join(`
|
|
25
|
+
`)}};o(_b,"PemConverter");var St=_b;St.CertificateTag="CERTIFICATE";St.CrlTag="CRL";St.CertificateRequestTag="CERTIFICATE REQUEST";St.PublicKeyTag="PUBLIC KEY";St.PrivateKeyTag="PRIVATE KEY";var Ff=class Ff extends Oi{static isAsnEncoded(e){return E.BufferSourceConverter.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(St.isPem(e))return St.decode(e)[0];if(E.Convert.isHex(e))return E.Convert.FromHex(e);if(E.Convert.isBase64(e))return E.Convert.FromBase64(e);if(E.Convert.isBase64Url(e))return E.Convert.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{let r=E.BufferSourceConverter.toUint8Array(e);if(r.length>0&&r[0]===48)return E.BufferSourceConverter.toArrayBuffer(e);let n=E.Convert.ToBinary(e);if(St.isPem(n))return St.decode(n)[0];if(E.Convert.isHex(n))return E.Convert.FromHex(n);if(E.Convert.isBase64(n))return E.Convert.FromBase64(n);if(E.Convert.isBase64Url(n))return E.Convert.FromBase64Url(n);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){Ff.isAsnEncoded(e[0])?super(Ff.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){return e==="pem"?St.encode(this.rawData,this.tag):super.toString(e)}};o(Ff,"PemData");var Ri=Ff,ha=class ha extends Ri{static async create(e,r=At.get()){if(e instanceof ha)return e;if(Jf.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");let n=await r.subtle.exportKey("spki",e);return new ha(n)}else{if(e.publicKey)return e.publicKey;if(E.BufferSourceConverter.isBufferSource(e))return new ha(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){Ri.isAsnEncoded(e)?super(e,ht):super(e),this.tag=St.PublicKeyTag}async export(...e){let r,n=["verify"],i={hash:"SHA-256",...this.algorithm};e.length>1?(i=e[0]||i,n=e[1]||n,r=e[2]||At.get()):r=e[0]||At.get();let s=this.rawData,u=j.parse(this.rawData,ht);return u.algorithm.algorithm===xi&&(s=o8(u,s)),r.subtle.importKey("spki",s,i,!0,n)}onInit(e){let r=Ie.resolve(ba),n=this.algorithm=r.toWebAlgorithm(e.algorithm);if(e.algorithm.algorithm===Xr){let i=j.parse(e.subjectPublicKey,Iu),s=E.BufferSourceConverter.toUint8Array(i.modulus);n.publicExponent=E.BufferSourceConverter.toUint8Array(i.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3}}async getThumbprint(...e){var r;let n,i="SHA-1";return e.length>=1&&!(!((r=e[0])===null||r===void 0)&&r.subtle)?(i=e[0]||i,n=e[1]||At.get()):n=e[0]||At.get(),await n.subtle.digest(i,this.rawData)}async getKeyIdentifier(...e){let r,n="SHA-1";e.length===1?typeof e[0]=="string"?(n=e[0],r=At.get()):r=e[0]:e.length===2?(n=e[0],r=e[1]):r=At.get();let i=j.parse(this.rawData,ht);return await r.subtle.digest(n,i.subjectPublicKey)}toTextObject(){let e=this.toTextObjectEmpty(),r=j.parse(this.rawData,ht);switch(e.Algorithm=Un.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case lo:e["EC Point"]=r.subjectPublicKey;break;case Xr:default:e["Raw Data"]=r.subjectPublicKey}return e}};o(ha,"PublicKey");var Ii=ha;function o8(t,e){return t.algorithm=new C({algorithm:Xr,parameters:null}),e=j.serialize(t),e}o(o8,"convertSpkiToRsaPkcs1");var zf=class zf extends Xt{static async create(e,r=!1,n=At.get()){if("name"in e&&"serialNumber"in e)return new zf(e,r);let s=await(await Ii.create(e,n)).getKeyIdentifier(n);return new zf(E.Convert.ToHex(s),r)}constructor(...e){if(E.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){let r=new zr({keyIdentifier:new Ji(E.Convert.FromHex(e[0]))});super(ml,e[1],j.serialize(r))}else{let r=e[0],n=r.name instanceof $n?j.parse(r.name.rawData,Ee):r.name,i=new zr({authorityCertIssuer:n,authorityCertSerialNumber:E.Convert.FromHex(r.serialNumber)});super(ml,e[1],j.serialize(i))}}onInit(e){super.onInit(e);let r=j.parse(e.extnValue,zr);r.keyIdentifier&&(this.keyId=E.Convert.ToHex(r.keyIdentifier)),(r.authorityCertIssuer||r.authorityCertSerialNumber)&&(this.certId={name:r.authorityCertIssuer||[],serialNumber:r.authorityCertSerialNumber?E.Convert.ToHex(r.authorityCertSerialNumber):""})}toTextObject(){let e=this.toTextObjectWithoutValue(),r=j.parse(this.value,zr);return r.authorityCertIssuer&&(e["Authority Issuer"]=new $n(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(e["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(e[""]=r.keyIdentifier),e}};o(zf,"AuthorityKeyIdentifierExtension");var op=zf;op.NAME="Authority Key Identifier";var xb=class xb extends Xt{constructor(...e){if(E.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=j.parse(this.value,Gi);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{let r=new Gi({cA:e[0],pathLenConstraint:e[1]});super(gl,e[2],j.serialize(r)),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}};o(xb,"BasicConstraintsExtension");var sp=xb;sp.NAME="Basic Constraints";var Kx;(function(t){t.serverAuth="1.3.6.1.5.5.7.3.1",t.clientAuth="1.3.6.1.5.5.7.3.2",t.codeSigning="1.3.6.1.5.5.7.3.3",t.emailProtection="1.3.6.1.5.5.7.3.4",t.timeStamping="1.3.6.1.5.5.7.3.8",t.ocspSigning="1.3.6.1.5.5.7.3.9"})(Kx||(Kx={}));var Ab=class Ab extends Xt{constructor(...e){if(E.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=j.parse(this.value,Hc);this.usages=r.map(n=>n)}else{let r=new Hc(e[0]);super(_l,e[1],j.serialize(r)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(r=>tn.toString(r)).join(", "),e}};o(Ab,"ExtendedKeyUsageExtension");var up=Ab;up.NAME="Extended Key Usages";var Jx;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(Jx||(Jx={}));var Sb=class Sb extends Xt{constructor(...e){if(E.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=j.parse(this.value,_s);this.usages=r.toNumber()}else{let r=new _s(e[0]);super(xl,e[1],j.serialize(r)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=j.parse(this.value,_s);return e[""]=r.toJSON().join(", "),e}};o(Sb,"KeyUsagesExtension");var ap=Sb;ap.NAME="Key Usages";var vp=class vp extends Xt{static async create(e,r=!1,n=At.get()){let s=await(await Ii.create(e,n)).getKeyIdentifier(n);return new vp(E.Convert.ToHex(s),r)}constructor(...e){if(E.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=j.parse(this.value,Dt);this.keyId=E.Convert.ToHex(r)}else{let r=typeof e[0]=="string"?E.Convert.FromHex(e[0]):e[0],n=new Dt(r);super(q0,e[1],j.serialize(n)),this.keyId=E.Convert.ToHex(r)}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=j.parse(this.value,Dt);return e[""]=r,e}};o(vp,"SubjectKeyIdentifierExtension");var cp=vp;cp.NAME="Subject Key Identifier";var kb=class kb extends Xt{constructor(...e){E.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(N0,e[1],new $n(e[0]||[]).rawData)}onInit(e){super.onInit(e);let r=j.parse(e.extnValue,Cl);this.names=new $n(r)}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(let n in r)e[n]=r[n];return e}};o(kb,"SubjectAlternativeNameExtension");var _a=kb;_a.NAME="Subject Alternative Name";var Cb=class Cb{static register(e,r){this.items.set(e,r)}static create(e){let r=new Xt(e),n=this.items.get(r.type);return n?new n(e):r}};o(Cb,"ExtensionFactory");var kt=Cb;kt.items=new Map;var Eb=class Eb extends Xt{constructor(...e){var r;if(E.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let n=j.parse(this.value,Mc);this.policies=n.map(i=>i.policyIdentifier)}else{let n=e[0],i=(r=e[1])!==null&&r!==void 0?r:!1,s=new Mc(n.map(u=>new Xi({policyIdentifier:u})));super(bl,i,j.serialize(s)),this.policies=n}}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(r=>new fe("",{},tn.toString(r))),e}};o(Eb,"CertificatePolicyExtension");var fp=Eb;fp.NAME="Certificate Policies";kt.register(bl,fp);var Pb=class Pb extends Xt{constructor(...e){var r;if(E.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){let i=e[0].map(u=>new Kr({distributionPoint:new jn({fullName:[new W({uniformResourceIdentifier:u})]})})),s=new pi(i);super(wl,e[1],j.serialize(s))}else{let n=new pi(e[0]);super(wl,e[1],j.serialize(n))}(r=this.distributionPoints)!==null&&r!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);let r=j.parse(e.extnValue,pi);this.distributionPoints=r}toTextObject(){let e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(r=>{var n;let i={};return r.distributionPoint&&(i[""]=(n=r.distributionPoint.fullName)===null||n===void 0?void 0:n.map(s=>new en(s).toString()).join(", ")),r.reasons&&(i.Reasons=r.reasons.toString()),r.cRLIssuer&&(i["CRL Issuer"]=r.cRLIssuer.map(s=>s.toString()).join(", ")),i}),e}};o(Pb,"CRLDistributionPointsExtension");var dp=Pb;dp.NAME="CRL Distribution Points";var Tb=class Tb extends Xt{constructor(...e){var r,n,i,s;if(E.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof Ki){let u=new Ki(e[0]);super(yl,e[1],j.serialize(u))}else{let u=e[0],a=new Ki;tp(a,u,r0,"ocsp"),tp(a,u,n0,"caIssuers"),tp(a,u,i0,"timeStamping"),tp(a,u,o0,"caRepository"),super(yl,e[1],j.serialize(a))}(r=this.ocsp)!==null&&r!==void 0||(this.ocsp=[]),(n=this.caIssuers)!==null&&n!==void 0||(this.caIssuers=[]),(i=this.timeStamping)!==null&&i!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],j.parse(e.extnValue,Ki).forEach(n=>{switch(n.accessMethod){case r0:this.ocsp.push(new en(n.accessLocation));break;case n0:this.caIssuers.push(new en(n.accessLocation));break;case i0:this.timeStamping.push(new en(n.accessLocation));break;case o0:this.caRepository.push(new en(n.accessLocation));break}})}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ocsp.length&&ep(e,"OCSP",this.ocsp),this.caIssuers.length&&ep(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&ep(e,"Time Stamping",this.timeStamping),this.caRepository.length&&ep(e,"CA Repository",this.caRepository),e}};o(Tb,"AuthorityInfoAccessExtension");var lp=Tb;lp.NAME="Authority Info Access";function ep(t,e,r){if(r.length===1)t[e]=r[0].toTextObject();else{let n=new fe("");r.forEach((i,s)=>{let u=i.toTextObject(),a=`${u[fe.NAME]} ${s+1}`,c=n[a];Array.isArray(c)||(c=[],n[a]=c),c.push(u)}),t[e]=n}}o(ep,"addUrlsToObject");function tp(t,e,r,n){let i=e[n];i&&(Array.isArray(i)?i:[i]).forEach(u=>{typeof u=="string"&&(u=new en("url",u)),t.push(new On({accessMethod:r,accessLocation:j.parse(u.rawData,W)}))})}o(tp,"addAccessDescriptions");var Ib=class Ib extends Xt{constructor(...e){E.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(k0,e[1],new $n(e[0]||[]).rawData)}onInit(e){super.onInit(e);let r=j.parse(e.extnValue,Ee);this.names=new $n(r)}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(let n in r)e[n]=r[n];return e}};o(Ib,"IssuerAlternativeNameExtension");var pp=Ib;pp.NAME="Issuer Alternative Name";var bp=class bp extends Oi{constructor(...e){let r;if(E.BufferSourceConverter.isBufferSource(e[0]))r=E.BufferSourceConverter.toArrayBuffer(e[0]);else{let n=e[0],i=Array.isArray(e[1])?e[1].map(s=>E.BufferSourceConverter.toArrayBuffer(s)):[];r=j.serialize(new ct({type:n,values:i}))}super(r,ct)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Value=this.values.map(r=>new fe("",{"":r})),e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty();return e[fe.NAME]===bp.NAME&&(e[fe.NAME]=tn.toString(this.type)),e}};o(bp,"Attribute");var xa=bp;xa.NAME="Attribute";var Ob=class Ob extends xa{constructor(...e){var r;if(E.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let n=new _f({printableString:e[0]});super(Kv,[j.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){let r=j.parse(this.values[0],_f);this.password=r.toString()}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[fe.VALUE]=this.password,e}};o(Ob,"ChallengePasswordAttribute");var hp=Ob;hp.NAME="Challenge Password";var Rb=class Rb extends xa{constructor(...e){var r;if(E.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let n=e[0],i=new pr;for(let s of n)i.push(j.parse(s.rawData,xt));super(Af,[j.serialize(i)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){let r=j.parse(this.values[0],pr);this.items=r.map(n=>kt.create(j.serialize(n)))}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.items.map(n=>n.toTextObject());for(let n of r)e[n[fe.NAME]]=n;return e}};o(Rb,"ExtensionsAttribute");var Xf=Rb;Xf.NAME="Extensions";var jb=class jb{static register(e,r){this.items.set(e,r)}static create(e){let r=new xa(e),n=this.items.get(r.type);return n?new n(e):r}};o(jb,"AttributeFactory");var Aa=jb;Aa.items=new Map;var wp="crypto.signatureFormatter",Nb=class Nb{toAsnSignature(e,r){return E.BufferSourceConverter.toArrayBuffer(r)}toWebSignature(e,r){return E.BufferSourceConverter.toArrayBuffer(r)}};o(Nb,"AsnDefaultSignatureFormatter");var ab=Nb,np,ma,cb=np=(ma=class{static createPssParams(e,r){let n=np.getHashAlgorithm(e);return n?new Zr({hashAlgorithm:n,maskGenAlgorithm:new C({algorithm:Ai,parameters:j.serialize(n)}),saltLength:r}):null}static getHashAlgorithm(e){let r=Ie.resolve(ba);return typeof e=="string"?r.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?r.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let r;if(typeof e.hash=="string")r=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")r=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new C({algorithm:Su,parameters:null});case"sha-256":return new C({algorithm:Ul,parameters:null});case"sha-384":return new C({algorithm:ku,parameters:null});case"sha-512":return new C({algorithm:Cu,parameters:null})}}else return new C({algorithm:Xr,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 r=np.createPssParams(e.hash,e.saltLength);if(!r)throw new Error("Cannot create PSS parameters");return new C({algorithm:xi,parameters:j.serialize(r)})}else return new C({algorithm:xi,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Xr:return{name:"RSASSA-PKCS1-v1_5"};case Su:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Ul:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case ku:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Cu:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case xi:if(e.parameters){let r=j.parse(e.parameters,Zr);return{name:"RSA-PSS",hash:Ie.resolve(ba).toWebAlgorithm(r.hashAlgorithm),saltLength:r.saltLength}}else return{name:"RSA-PSS"}}return null}},o(ma,"RsaAlgorithm"),ma);cb=np=f([ki()],cb);Ie.registerSingleton(Zf,cb);var ga,fb=(ga=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new C({algorithm:ho});case"sha-256":return new C({algorithm:yo});case"sha-384":return new C({algorithm:mo});case"sha-512":return new C({algorithm:go})}return null}toWebAlgorithm(e){switch(e.algorithm){case ho:return{name:"SHA-1"};case yo:return{name:"SHA-256"};case mo:return{name:"SHA-384"};case go:return{name:"SHA-512"}}return null}},o(ga,"ShaAlgorithm"),ga);fb=f([ki()],fb);Ie.registerSingleton(Zf,fb);var ko=class ko{addPadding(e,r){let n=E.BufferSourceConverter.toUint8Array(r),i=new Uint8Array(e);return i.set(n,e-n.length),i.buffer}removePadding(e,r=!1){let n=E.BufferSourceConverter.toUint8Array(e);for(let i=0;i<n.length;i++)if(n[i]){n=n.slice(i);break}if(r&&n[0]>127){let i=new Uint8Array(n.length+1);return i.set(n,1),i.buffer}return n.buffer}toAsnSignature(e,r){if(e.name==="ECDSA"){let n=e.namedCurve,i=ko.namedCurveSize.get(n)||ko.defaultNamedCurveSize,s=new po,u=E.BufferSourceConverter.toUint8Array(r);return s.r=this.removePadding(u.slice(0,i),!0),s.s=this.removePadding(u.slice(i,i+i),!0),j.serialize(s)}return null}toWebSignature(e,r){if(e.name==="ECDSA"){let n=j.parse(r,po),i=e.namedCurve,s=ko.namedCurveSize.get(i)||ko.defaultNamedCurveSize,u=this.addPadding(s,this.removePadding(n.r)),a=this.addPadding(s,this.removePadding(n.s));return(0,E.combine)(u,a)}return null}};o(ko,"AsnEcSignatureFormatter");var Vn=ko;Vn.namedCurveSize=new Map;Vn.defaultNamedCurveSize=32;var ib="1.3.101.110",Gx="1.3.101.111",ob="1.3.101.112",Xx="1.3.101.113",va,db=(va=class{toAsnAlgorithm(e){let r=null;switch(e.name.toLowerCase()){case"ed25519":r=ob;break;case"x25519":r=ib;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":r=ob;break;case"ed448":r=Xx;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":r=ib;break;case"x448":r=Gx;break}}return r?new C({algorithm:r}):null}toWebAlgorithm(e){switch(e.algorithm){case ob:return{name:"Ed25519"};case Xx:return{name:"EdDSA",namedCurve:"Ed448"};case ib:return{name:"X25519"};case Gx:return{name:"ECDH-ES",namedCurve:"X448"}}return null}},o(va,"EdAlgorithm"),va);db=f([ki()],db);Ie.registerSingleton(Zf,db);var Cf,Ef,Pf,Tf,If,Of,Rf,la,Bb=class Bb extends Ri{get subjectName(){return Z(this,Ef,"f")||Ce(this,Ef,new Co(this.asn.certificationRequestInfo.subject),"f"),Z(this,Ef,"f")}get subject(){return Z(this,Pf,"f")||Ce(this,Pf,this.subjectName.toString(),"f"),Z(this,Pf,"f")}get signatureAlgorithm(){if(!Z(this,Tf,"f")){let e=Ie.resolve(ba);Ce(this,Tf,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return Z(this,Tf,"f")}get signature(){return Z(this,If,"f")||Ce(this,If,this.asn.signature,"f"),Z(this,If,"f")}get publicKey(){return Z(this,Of,"f")||Ce(this,Of,new Ii(this.asn.certificationRequestInfo.subjectPKInfo),"f"),Z(this,Of,"f")}get attributes(){return Z(this,Rf,"f")||Ce(this,Rf,this.asn.certificationRequestInfo.attributes.map(e=>Aa.create(j.serialize(e))),"f"),Z(this,Rf,"f")}get extensions(){if(!Z(this,la,"f")){Ce(this,la,[],"f");let e=this.getAttribute(Af);e instanceof Xf&&Ce(this,la,e.items,"f")}return Z(this,la,"f")}get tbs(){return Z(this,Cf,"f")||Ce(this,Cf,this.asn.certificationRequestInfoRaw||j.serialize(this.asn.certificationRequestInfo),"f"),Z(this,Cf,"f")}constructor(e){let r=Ri.isAsnEncoded(e)?[e,Ti]:[e];super(r[0],r[1]),Cf.set(this,void 0),Ef.set(this,void 0),Pf.set(this,void 0),Tf.set(this,void 0),If.set(this,void 0),Of.set(this,void 0),Rf.set(this,void 0),la.set(this,void 0),this.tag=St.CertificateRequestTag}onInit(e){}getAttribute(e){for(let r of this.attributes)if(r.type===e)return r;return null}getAttributes(e){return this.attributes.filter(r=>r.type===e)}getExtension(e){for(let r of this.extensions)if(r.type===e)return r;return null}getExtensions(e){return this.extensions.filter(r=>r.type===e)}async verify(e=At.get()){let r={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(r,["verify"],e),i=Ie.resolveAll(wp).reverse(),s=null;for(let a of i)if(s=a.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,n,s,this.tbs)}toTextObject(){let e=this.toTextObjectEmpty(),r=j.parse(this.rawData,Ti),n=r.certificationRequestInfo,i=new fe("",{Version:`${Nn[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let s=new fe("");for(let u of this.attributes){let a=u.toTextObject();s[a[fe.NAME]]=a}i.Attributes=s}return e.Data=i,e.Signature=new fe("",{Algorithm:Un.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),e}};o(Bb,"Pkcs10CertificateRequest");var lb=Bb;Cf=new WeakMap,Ef=new WeakMap,Pf=new WeakMap,Tf=new WeakMap,If=new WeakMap,Of=new WeakMap,Rf=new WeakMap,la=new WeakMap;lb.NAME="PKCS#10 Certificate Request";var jf,Nf,Bf,Df,qf,Mf,Uf,$f,Vf,Lf,pa,Hf,Db=class Db extends Ri{get publicKey(){return Z(this,Hf,"f")||Ce(this,Hf,new Ii(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),Z(this,Hf,"f")}get serialNumber(){if(!Z(this,Nf,"f")){let e=this.asn.tbsCertificate,r=new Uint8Array(e.serialNumber);r.length>1&&r[0]===0&&r[1]>127&&(r=r.slice(1)),Ce(this,Nf,E.Convert.ToHex(r),"f")}return Z(this,Nf,"f")}get subjectName(){return Z(this,Bf,"f")||Ce(this,Bf,new Co(this.asn.tbsCertificate.subject),"f"),Z(this,Bf,"f")}get subject(){return Z(this,Df,"f")||Ce(this,Df,this.subjectName.toString(),"f"),Z(this,Df,"f")}get issuerName(){return Z(this,qf,"f")||Ce(this,qf,new Co(this.asn.tbsCertificate.issuer),"f"),Z(this,qf,"f")}get issuer(){return Z(this,Mf,"f")||Ce(this,Mf,this.issuerName.toString(),"f"),Z(this,Mf,"f")}get notBefore(){if(!Z(this,Uf,"f")){let e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");Ce(this,Uf,e,"f")}return Z(this,Uf,"f")}get notAfter(){if(!Z(this,$f,"f")){let e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");Ce(this,$f,e,"f")}return Z(this,$f,"f")}get signatureAlgorithm(){if(!Z(this,Vf,"f")){let e=Ie.resolve(ba);Ce(this,Vf,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return Z(this,Vf,"f")}get signature(){return Z(this,Lf,"f")||Ce(this,Lf,this.asn.signatureValue,"f"),Z(this,Lf,"f")}get extensions(){return Z(this,pa,"f")||(Ce(this,pa,[],"f"),this.asn.tbsCertificate.extensions&&Ce(this,pa,this.asn.tbsCertificate.extensions.map(e=>kt.create(j.serialize(e))),"f")),Z(this,pa,"f")}get tbs(){return Z(this,jf,"f")||Ce(this,jf,this.asn.tbsCertificateRaw||j.serialize(this.asn.tbsCertificate),"f"),Z(this,jf,"f")}constructor(e){let r=Ri.isAsnEncoded(e)?[e,Ir]:[e];super(r[0],r[1]),jf.set(this,void 0),Nf.set(this,void 0),Bf.set(this,void 0),Df.set(this,void 0),qf.set(this,void 0),Mf.set(this,void 0),Uf.set(this,void 0),$f.set(this,void 0),Vf.set(this,void 0),Lf.set(this,void 0),pa.set(this,void 0),Hf.set(this,void 0),this.tag=St.CertificateTag}onInit(e){}getExtension(e){for(let r of this.extensions)if(typeof e=="string"){if(r.type===e)return r}else if(r instanceof e)return r;return null}getExtensions(e){return this.extensions.filter(r=>typeof e=="string"?r.type===e:r instanceof e)}async verify(e={},r=At.get()){let n,i,s=e.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(n,["verify"],r);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},i=await s.publicKey.export(n,["verify"],r);else if(s instanceof Ii)n={...s.algorithm,...this.signatureAlgorithm},i=await s.export(n,["verify"],r);else if(E.BufferSourceConverter.isBufferSource(s)){let d=new Ii(s);n={...d.algorithm,...this.signatureAlgorithm},i=await d.export(n,["verify"],r)}else n={...s.algorithm,...this.signatureAlgorithm},i=s}catch{return!1}let u=Ie.resolveAll(wp).reverse(),a=null;for(let d of u)if(a=d.toWebSignature(n,this.signature),a)break;if(!a)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");let c=await r.subtle.verify(this.signatureAlgorithm,i,a,this.tbs);if(e.signatureOnly)return c;{let h=(e.date||new Date).getTime();return c&&this.notBefore.getTime()<h&&h<this.notAfter.getTime()}}async getThumbprint(...e){let r,n="SHA-1";return e[0]&&(e[0].subtle?r=e[0]:(n=e[0]||n,r=e[1])),r??(r=At.get()),await r.subtle.digest(n,this.rawData)}async isSelfSigned(e=At.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){let e=this.toTextObjectEmpty(),r=j.parse(this.rawData,Ir),n=r.tbsCertificate,i=new fe("",{Version:`${Nn[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":Un.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new fe("",{"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 s=new fe("");for(let u of this.extensions){let a=u.toTextObject();s[a[fe.NAME]]=a}i.Extensions=s}return e.Data=i,e.Signature=new fe("",{Algorithm:Un.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),e}};o(Db,"X509Certificate");var Sa=Db;jf=new WeakMap,Nf=new WeakMap,Bf=new WeakMap,Df=new WeakMap,qf=new WeakMap,Mf=new WeakMap,Uf=new WeakMap,$f=new WeakMap,Vf=new WeakMap,Lf=new WeakMap,pa=new WeakMap,Hf=new WeakMap;Sa.NAME="Certificate";var s8,u8,a8,c8,f8,Zx;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(Zx||(Zx={}));s8=new WeakMap,u8=new WeakMap,a8=new WeakMap,c8=new WeakMap,f8=new WeakMap;var d8,l8,p8,h8,y8,m8,g8;d8=new WeakMap,l8=new WeakMap,p8=new WeakMap,h8=new WeakMap,y8=new WeakMap,m8=new WeakMap,g8=new WeakMap;kt.register(gl,sp);kt.register(_l,up);kt.register(xl,ap);kt.register(q0,cp);kt.register(ml,op);kt.register(N0,_a);kt.register(wl,dp);kt.register(yl,lp);kt.register(k0,pp);Aa.register(Kv,hp);Aa.register(Af,Xf);Ie.registerSingleton(wp,ab);Ie.registerSingleton(wp,Vn);Vn.namedCurveSize.set("P-256",32);Vn.namedCurveSize.set("K-256",32);Vn.namedCurveSize.set("P-384",48);Vn.namedCurveSize.set("P-521",66);var b8=["pre-registered","redirect_uri","https","did","verifier_attestation","x509_san_dns","x509_hash"],_p=o((t,e)=>{if(typeof t!="string"||t.length===0)return{prefix:"pre-registered",value:"",inferred:!0};if(typeof e=="string"&&e.length>0&&w8(e))return{prefix:e,value:t,inferred:!1};let r=["redirect_uri","verifier_attestation","x509_san_dns","x509_hash"];for(let n of r){let i=`${n}:`;if(t.startsWith(i))return{prefix:n,value:t.slice(i.length),inferred:!1}}return t.startsWith("https://")?{prefix:"https",value:t,inferred:!0}:/^did:[a-z0-9]+:/.test(t)?{prefix:"did",value:t,inferred:!0}:{prefix:"pre-registered",value:t,inferred:!0}},"deriveClientIdPrefix"),w8=o(t=>b8.includes(t),"isKnownPrefix");var qb;function Mb(t){return{lang:t?.lang??qb?.lang,message:t?.message,abortEarly:t?.abortEarly??qb?.abortEarly,abortPipeEarly:t?.abortPipeEarly??qb?.abortPipeEarly}}o(Mb,"getGlobalConfig");var _8;function x8(t){return _8?.get(t)}o(x8,"getGlobalMessage");var A8;function S8(t){return A8?.get(t)}o(S8,"getSchemaMessage");var k8;function C8(t,e){return k8?.get(t)?.get(e)}o(C8,"getSpecificMessage");function Qf(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}o(Qf,"_stringify");function Pe(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,u=i?.expected??t.expects??null,a=i?.received??Qf(s),c={kind:t.kind,type:t.type,input:s,expected:u,received:a,message:`Invalid ${e}: ${u?`Expected ${u} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},d=t.kind==="schema",h=i?.message??t.message??C8(t.reference,c.lang)??(d?S8(c.lang):null)??n.message??x8(c.lang);h!==void 0&&(c.message=typeof h=="function"?h(c):h),d&&(r.typed=!1),r.issues?r.issues.push(c):r.issues=[c]}o(Pe,"_addIssue");function $e(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Mb())}}}o($e,"_getStandardProps");function E8(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}o(E8,"_isValidObjectKey");function Ub(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}o(Ub,"_joinExpects");function P8(t){if(t.path){let e="";for(let r of t.path)if(typeof r.key=="string"||typeof r.key=="number")e?e+=`.${r.key}`:e+=r.key;else return null;return e}return null}o(P8,"getDotPath");var ka,$b=(ka=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}},o(ka,"ValiError"),ka);function Yf(t,e){return{kind:"validation",type:"check",reference:Yf,async:!1,expects:null,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement(r.value)&&Pe(this,"input",r,n),r}}}o(Yf,"check");function X(t){return{kind:"metadata",type:"description",reference:X,description:t}}o(X,"description");function xp(t){return{kind:"validation",type:"integer",reference:xp,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&Pe(this,"integer",e,r),e}}}o(xp,"integer");function Vb(t,e){return{kind:"validation",type:"min_value",reference:Vb,async:!1,expects:`>=${t instanceof Date?t.toJSON():Qf(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value>=this.requirement)&&Pe(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():Qf(r.value)}),r}}}o(Vb,"minValue");function Lb(t){return{kind:"validation",type:"non_empty",reference:Lb,async:!1,expects:"!0",message:t,"~run"(e,r){return e.typed&&e.value.length===0&&Pe(this,"length",e,r,{received:"0"}),e}}}o(Lb,"nonEmpty");function Eo(t){return{kind:"transformation",type:"raw_transform",reference:Eo,async:!1,"~run"(e,r){let n=t({dataset:e,config:r,addIssue:o(i=>Pe(this,i?.label??"input",e,r,i),"addIssue"),NEVER:null});return e.issues?e.typed=!1:e.value=n,e}}}o(Eo,"rawTransform");function ed(t,e){return{kind:"validation",type:"regex",reference:ed,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement.test(r.value)&&Pe(this,"format",r,n),r}}}o(ed,"regex");function Hb(t,e){return{kind:"validation",type:"some_item",reference:Hb,async:!1,expects:null,requirement:t,message:e,"~run"(r,n){return r.typed&&!r.value.some(this.requirement)&&Pe(this,"item",r,n),r}}}o(Hb,"someItem");function Wb(t){return{kind:"transformation",type:"transform",reference:Wb,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}o(Wb,"transform");function Ap(t){return{kind:"validation",type:"url",reference:Ap,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&Pe(this,"URL",e,r),e}}}o(Ap,"url");function T8(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}o(T8,"getFallback");function td(t){let e={};for(let r of t)if(r.path){let n=P8(r);n?(e.nested||(e.nested={}),e.nested[n]?e.nested[n].push(r.message):e.nested[n]=[r.message]):e.other?e.other.push(r.message):e.other=[r.message]}else e.root?e.root.push(r.message):e.root=[r.message];return e}o(td,"flatten");function nA(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}o(nA,"getDefault");function Fb(t,e){return!t["~run"]({value:e},{abortEarly:!0}).issues}o(Fb,"is");function rd(){return{kind:"schema",type:"any",reference:rd,expects:"any",async:!1,get"~standard"(){return $e(this)},"~run"(t){return t.typed=!0,t}}}o(rd,"any");function Ht(t,e){return{kind:"schema",type:"array",reference:Ht,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return $e(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let u=i[s],a=this.item["~run"]({value:u},n);if(a.issues){let c={type:"array",origin:"value",input:i,key:s,value:u};for(let d of a.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else Pe(this,"type",r,n);return r}}}o(Ht,"array");function jr(t){return{kind:"schema",type:"boolean",reference:jr,expects:"boolean",async:!1,message:t,get"~standard"(){return $e(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:Pe(this,"type",e,r),e}}}o(jr,"boolean");function nd(t,e){return{kind:"schema",type:"custom",reference:nd,expects:"unknown",async:!1,check:t,message:e,get"~standard"(){return $e(this)},"~run"(r,n){return this.check(r.value)?r.typed=!0:Pe(this,"type",r,n),r}}}o(nd,"custom");function Sp(t){return{kind:"schema",type:"lazy",reference:Sp,expects:"unknown",async:!1,getter:t,get"~standard"(){return $e(this)},"~run"(e,r){return this.getter(e.value)["~run"](e,r)}}}o(Sp,"lazy");function ge(t,e){return{kind:"schema",type:"literal",reference:ge,expects:Qf(t),async:!1,literal:t,message:e,get"~standard"(){return $e(this)},"~run"(r,n){return r.value===this.literal?r.typed=!0:Pe(this,"type",r,n),r}}}o(ge,"literal");function kp(t){return{kind:"schema",type:"null",reference:kp,expects:"null",async:!1,message:t,get"~standard"(){return $e(this)},"~run"(e,r){return e.value===null?e.typed=!0:Pe(this,"type",e,r),e}}}o(kp,"null_");function lt(t){return{kind:"schema",type:"number",reference:lt,expects:"number",async:!1,message:t,get"~standard"(){return $e(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Pe(this,"type",e,r),e}}}o(lt,"number");function z(t,e){return{kind:"schema",type:"object",reference:z,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return $e(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let u=this.entries[s];if(s in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){let a=s in i?i[s]:nA(u),c=u["~run"]({value:a},n);if(c.issues){let d={type:"object",origin:"value",input:i,key:s,value:a};for(let h of c.issues)h.path?h.path.unshift(d):h.path=[d],r.issues?.push(h);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),r.value[s]=c.value}else if(u.fallback!==void 0)r.value[s]=T8(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(Pe(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else Pe(this,"type",r,n);return r}}}o(z,"object");function Y(t,e){return{kind:"schema",type:"optional",reference:Y,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return $e(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=nA(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}o(Y,"optional");function Po(t,e){return{kind:"schema",type:"picklist",reference:Po,expects:Ub(t.map(Qf),"|"),async:!1,options:t,message:e,get"~standard"(){return $e(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:Pe(this,"type",r,n),r}}}o(Po,"picklist");function Ct(t,e,r){return{kind:"schema",type:"record",reference:Ct,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return $e(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let u in s)if(E8(s,u)){let a=s[u],c=this.key["~run"]({value:u},i);if(c.issues){let h={type:"object",origin:"key",input:s,key:u,value:a};for(let y of c.issues)y.path=[h],n.issues?.push(y);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}let d=this.value["~run"]({value:a},i);if(d.issues){let h={type:"object",origin:"value",input:s,key:u,value:a};for(let y of d.issues)y.path?y.path.unshift(h):y.path=[h],n.issues?.push(y);if(n.issues||(n.issues=d.issues),i.abortEarly){n.typed=!1;break}}(!c.typed||!d.typed)&&(n.typed=!1),c.typed&&(n.value[c.value]=d.value)}}else Pe(this,"type",n,i);return n}}}o(Ct,"record");function oe(t){return{kind:"schema",type:"string",reference:oe,expects:"string",async:!1,message:t,get"~standard"(){return $e(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:Pe(this,"type",e,r),e}}}o(oe,"string");function zb(t,e){return{kind:"schema",type:"tuple",reference:zb,expects:"Array",async:!1,items:t,message:e,get"~standard"(){return $e(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<this.items.length;s++){let u=i[s],a=this.items[s]["~run"]({value:u},n);if(a.issues){let c={type:"array",origin:"value",input:i,key:s,value:u};for(let d of a.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else Pe(this,"type",r,n);return r}}}o(zb,"tuple");function Nr(t){return{kind:"schema",type:"undefined",reference:Nr,expects:"undefined",async:!1,message:t,get"~standard"(){return $e(this)},"~run"(e,r){return e.value===void 0?e.typed=!0:Pe(this,"type",e,r),e}}}o(Nr,"undefined_");function rA(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}o(rA,"_subIssues");function Re(t,e){return{kind:"schema",type:"union",reference:Re,expects:Ub(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return $e(this)},"~run"(r,n){let i,s,u;for(let a of this.options){let c=a["~run"]({value:r.value},n);if(c.typed)if(c.issues)s?s.push(c):s=[c];else{i=c;break}else u?u.push(c):u=[c]}if(i)return i;if(s){if(s.length===1)return s[0];Pe(this,"type",r,n,{issues:rA(s)}),r.typed=!0}else{if(u?.length===1)return u[0];Pe(this,"type",r,n,{issues:rA(u)})}return r}}}o(Re,"union");function vr(){return{kind:"schema",type:"unknown",reference:vr,expects:"unknown",async:!1,get"~standard"(){return $e(this)},"~run"(t){return t.typed=!0,t}}}o(vr,"unknown");function Ln(t,e,r){return{kind:"schema",type:"variant",reference:Ln,expects:"Object",async:!1,key:t,options:e,message:r,get"~standard"(){return $e(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){let u,a=0,c=this.key,d=[],h=o((y,b)=>{for(let A of y.options){if(A.type==="variant")h(A,new Set(b).add(A.key));else{let S=!0,D=0;for(let I of b){let J=A.entries[I];if(I in s?J["~run"]({typed:!1,value:s[I]},{abortEarly:!0}).issues:J.type!=="exact_optional"&&J.type!=="optional"&&J.type!=="nullish"){S=!1,c!==I&&(a<D||a===D&&I in s&&!(c in s))&&(a=D,c=I,d=[]),c===I&&d.push(A.entries[I].expects);break}D++}if(S){let I=A["~run"]({value:s},i);(!u||!u.typed&&I.typed)&&(u=I)}}if(u&&!u.issues)break}},"parseOptions");if(h(this,new Set([this.key])),u)return u;Pe(this,"type",n,i,{input:s[c],expected:Ub(d,"|"),path:[{type:"object",origin:"value",input:s,key:c,value:s[c]}]})}else Pe(this,"type",n,i);return n}}}o(Ln,"variant");function iA(t,e){return{...t,get"~standard"(){return $e(this)},"~run"(r,n){return t["~run"](r,{...n,message:e})}}}o(iA,"message");function oA(t,e){let r={...t.entries};for(let n of e)delete r[n];return{...t,entries:r,get"~standard"(){return $e(this)}}}o(oA,"omit");function id(t,e,r){let n=t["~run"]({value:e},Mb(r));if(n.issues)throw new $b(n.issues);return n.value}o(id,"parse");function Cp(t,e){let r={};for(let n of e)r[n]=t.entries[n];return{...t,entries:r,get"~standard"(){return $e(this)}}}o(Cp,"pick");function L(...t){return{...t[0],pipe:t,get"~standard"(){return $e(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}o(L,"pipe");function rn(t,e,r){let n=t["~run"]({value:e},Mb(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}o(rn,"safeParse");function O8(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}o(O8,"isObject");var Ea,R8=(Ea=class extends Error{},o(Ea,"UnknownCauseError"),Ea);function j8(t){if(t instanceof Error)return t;let e=typeof t;if(!(e==="undefined"||e==="function"||t===null)){if(e!=="object")return new Error(String(t));if(O8(t)){let r=new R8;for(let n in t)r[n]=t[n];return r}}}o(j8,"getCauseFromUnknown");var Pa,nn=(Pa=class extends Error{constructor(e){let r=j8(e.cause),n=e.message??r?.message??e.code;super(n,{cause:r}),this.code=e.code,this.name="DcqlError",this.cause||(this.cause=r)}},o(Pa,"DcqlError"),Pa),Ta,N8=(Ta=class extends nn{constructor(e){super({code:"BAD_REQUEST",...e})}},o(Ta,"DcqlCredentialSetError"),Ta),Ia,B8=(Ia=class extends nn{constructor(e){super({code:"BAD_REQUEST",...e})}},o(Ia,"DcqlUndefinedClaimSetIdError"),Ia),Oa,D8=(Oa=class extends nn{constructor(e){super({code:"BAD_REQUEST",...e})}},o(Oa,"DcqlNonUniqueCredentialQueryIdsError"),Oa),Ra,hA=(Ra=class extends nn{constructor(e){super({code:"PARSE_ERROR",...e})}},o(Ra,"DcqlParseError"),Ra);var ja,q8=(ja=class extends nn{constructor(e){super({code:"BAD_REQUEST",...e})}},o(ja,"DcqlInvalidPresentationRecordError"),ja),Na,Kb=(Na=class extends nn{constructor(e){super({code:"BAD_REQUEST",...e})}},o(Na,"DcqlPresentationResultError"),Na),yA=/^[a-zA-Z0-9_-]+$/;function Hn(t){return t.length>0?t:void 0}o(Hn,"asNonEmptyArrayOrUndefined");function mA(t){return t.length>0}o(mA,"isNonEmptyArray");var ue=o(t=>L(Ht(t,e=>`Expected input to be an array, but received '${e.received}'`),nd(e=>e.length>0,"Array must be non-empty and have length of at least 1")),"vNonEmptyArray"),M8=o(t=>nd(e=>Array.isArray(e)?t.every(r=>e.includes(r)):!1,`Value must include all of: ${t.join(", ")}`),"vIncludesAll"),Br=L(oe(),ed(yA),Lb()),U8=ed(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==)?|[\w-]{3}=?)?$/iu,"must be base64url");function $8(t){return t===null||typeof t!="object"?!1:typeof t.toJson=="function"}o($8,"isToJsonable");var V8=o(t=>L(nd(()=>!0),Eo(({dataset:e,addIssue:r,NEVER:n})=>{let i=rn(t,e.value);if(i.success)return e.value;if(!$8(e.value)){for(let a of i.issues)r({...a,expected:a.expected??void 0});return n}let s;try{s=e.value.toJson()}catch{for(let a of i.issues)r({...a,expected:a.expected??void 0});return r({message:"Json Transformation failed"}),n}let u=rn(t,s);if(u.success)return e.value;for(let a of u.issues)r({...a,expected:a.expected??void 0});return n})),"vWithJT"),gA=Re([oe(),lt(),jr(),kp()]),od=Sp(()=>Re([gA,Ht(od),Ct(oe(),od)])),rte=Sp(()=>V8(Re([gA,Ht(od),Ct(oe(),od)]))),e1=Ct(oe(),od),L8=Eo(({dataset:t,addIssue:e,NEVER:r})=>{try{return JSON.parse(t.value)}catch{return e({message:"Invalid JSON"}),r}});function sA(t,e){let r=L(Y(t,()=>{}),t);return e?iA(r,e):r}o(sA,"vCustomRequiredMessage");var H8=o(t=>L(z({type:ge(t.type,e=>`Expected trusted authority type to be '${t.type}' but received ${typeof e.input=="string"?`'${e.input}'`:e.input}`),values:L(ue(oe()),Hb(e=>t.values.includes(e),e=>`Expected one of the trusted authority values to be '${t.values.join("' | '")}' but received '${e.input.join("' , '")}'`))},`Expected trusted authority object with type '${t.type}' to be defined, but received undefined`),Wb(({values:e,...r})=>({...r,value:e.find(n=>t.values.includes(n))}))),"getTrustedAuthorityParser"),vA=[z({type:ge("aki"),values:ue(L(oe("aki trusted authority value must be a string"),U8,X("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.")))}),z({type:ge("etsi_tl"),values:ue(L(oe("etsi_tl trusted authority value must be a string"),Ap("etsi_tl trusted authority value must be a valid https url"),Yf(t=>t.startsWith("http://")||t.startsWith("https://"),"etsi_tl trusted authority value must be a valid https url"),X("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.")))}),z({type:ge("openid_federation"),values:ue(L(oe("openid_federation trusted authority value must be a string"),Ap("openid_federation trusted authority value must be a valid https url"),Yf(t=>t.startsWith("http://")||t.startsWith("https://"),"openid_federation trusted authority value must be a valid https url"),X("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.")))})],Jb;(function(t){let e=vA.map(r=>z({type:L(r.entries.type,X("REQUIRED. A string uniquely identifying the type of information about the issuer trust framework.")),values:L(ue(r.entries.values.item),X("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."))}));t.vModel=Ln("type",e)})(Jb||(Jb={}));var Pp;(function(t){t.vModel=Ln("type",vA)})(Pp||(Pp={}));var Ba,ji=(Ba=class{constructor(e){this.input=e}get v(){return this.input.vModel}parse(e){let r=this.safeParse(e);return r.success?r.output:new hA({message:JSON.stringify(r.flattened),cause:r.error})}safeParse(e){let r=rn(this.input.vModel,e);return r.success?{success:!0,output:r.output}:{success:!1,error:new $b(r.issues),flattened:td(r.issues)}}is(e){return Fb(this.v,e)}},o(Ba,"ModelDefinition"),Ba),t1=z({authority:Y(Pp.vModel),cryptographic_holder_binding:L(jr(),X("Indicates support/inclusion of cryptographic holder binding. This will be checked against the `require_cryptographic_holder_binding` property from the query."))}),Da;(function(t){let e=t.vNamespaces=Ct(oe(),Ct(oe(),vr()));t.model=new ji({vModel:t.vModel=z({...t1.entries,credential_format:ge("mso_mdoc"),doctype:oe(),namespaces:e})})})(Da||(Da={}));var qa;(function(t){let e=t.vClaims=e1;t.model=new ji({vModel:t.vModel=z({...t1.entries,credential_format:Po(["vc+sd-jwt","dc+sd-jwt"]),vct:oe(),claims:e})})})(qa||(qa={}));var Ma;(function(t){let e=t.vClaims=e1;t.model=new ji({vModel:t.vModel=z({...t1.entries,credential_format:Po(["ldp_vc","jwt_vc_json","vc+sd-jwt"]),claims:e,type:Ht(oe())})})})(Ma||(Ma={}));var uA;(function(t){t.model=new ji({vModel:t.vModel=Ln("credential_format",[Da.vModel,qa.vModel,Ma.vModel])})})(uA||(uA={}));var Gb;(function(t){t.model=new ji({vModel:t.vModel=Da.vModel})})(Gb||(Gb={}));var Xb;(function(t){t.model=new ji({vModel:t.vModel=qa.vModel})})(Xb||(Xb={}));var Zb;(function(t){t.model=new ji({vModel:t.vModel=Ma.vModel})})(Zb||(Zb={}));var aA;(function(t){t.model=new ji({vModel:Ln("credential_format",[Gb.vModel,Xb.vModel,Zb.vModel])})})(aA||(aA={}));var cA;(function(t){let e=Re([oe(),e1]),r=t.vModel=L(Re([Ct(Br,ue(e)),Ct(Br,e)]),X("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."));t.parse=n=>typeof n=="string"?id(L(oe(),L8,r),n):id(r,n),t.encode=n=>JSON.stringify(n)})(cA||(cA={}));var Ca;(function(t){let e=t.vValue=Re([oe(),L(lt(),xp()),jr()]),r=t.vPath=Re([oe(),L(lt(),xp(),Vb(0)),kp()]),n=t.vW3cSdJwtVc=z({id:L(Y(Br),X("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:L(ue(r),X("A non-empty array representing a claims path pointer that specifies the path to a claim within the Verifiable Credential.")),values:L(Y(Ht(e)),X("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=z({id:L(Y(Br),X("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:L(Y(Ht(e)),X("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."))}),s=t.vMdocNamespace=z({...i.entries,namespace:L(oe(),X("A string that specifies the namespace of the data element within the mdoc, e.g., org.iso.18013.5.1.")),claim_name:L(oe(),X("A string that specifies the data element identifier of the data element within the provided namespace in the mdoc, e.g., first_name."))}),u=t.vMdocPath=z({...i.entries,intent_to_retain:L(Y(jr()),X("A boolean that is equivalent to `IntentToRetain` variable defined in Section 8.3.2.1.2.1 of [@ISO.18013-5].")),path:L(zb([L(oe(),X("A string that specifies the namespace of the data element within the mdoc, e.g., org.iso.18013.5.1.")),L(oe(),X("A string that specifies the data element identifier of the data element within the provided namespace in the mdoc, e.g., first_name."))]),X("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."))}),a=t.vMdoc=Re([s,u]);t.vModel=Re([a,n])})(Ca||(Ca={}));function Qb(t,e){let r=e;if(Object.getPrototypeOf(t)!==Object.prototype&&!Array.isArray(t))throw new nn({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 nn({message:"target value provided to deepMerge is neither an array or object.",code:"PARSE_ERROR"});for(let[n,i]of Object.entries(t))if(i!==null&&typeof i=="object"&&(Object.getPrototypeOf(i)===Object.prototype||Array.isArray(i))){let s=Qb(i,r[n]??new(Object.getPrototypeOf(i)).constructor);r=fA(r,n,s)}else i!=null&&(r=fA(r,n,i));return r}o(Qb,"deepMerge");function fA(t,e,r){let n=t;if(Array.isArray(n))n=[...n],n[e]=r;else if(Object.getPrototypeOf(n)===Object.prototype)n={...n,[e]:r};else throw new nn({message:"Unsupported type for deep merge. Only primitive types or Array and Object are supported",code:"INTERNAL_SERVER_ERROR"});return n}o(fA,"setValue");var Wn=o(t=>t.map(e=>typeof e=="string"?`'${e}'`:`${e}`).join("."),"pathToString"),bA=o((t,e)=>e?Re(e.map(r=>ge(r,n=>`Expected claim ${Wn(t)} to be ${typeof r=="string"?`'${r}'`:r} but received ${typeof n.input=="string"?`'${n.input}'`:n.input}`)),r=>`Expected claim ${Wn(t)} to be ${e.map(n=>typeof n=="string"?`'${n}'`:n).join(" | ")} but received ${typeof r.input=="string"?`'${r.input}'`:r.input}`):L(vr(),Yf(r=>r!=null,`Expected claim '${t.join("'.'")}' to be defined`)),"getClaimParser"),W8=o(t=>{let e=Fb(Ca.vMdocNamespace,t)?{id:t.id,path:[t.namespace,t.claim_name],values:t.values}:t,r=e.path[0],n=e.path[1];return z({[r]:z({[n]:bA(e.path,t.values)},`Expected claim ${Wn(e.path)} to be defined`)},`Expected claim ${Wn(e.path)} to be defined`)},"getMdocClaimParser"),Ep=o((t,e)=>{let{index:r,presentation:n}=e,i=t.path[r],s=r===t.path.length-1,u=bA(t.path,t.values);if(typeof i=="number"){let a=s?u:Ep(t,{...e,index:r+1});return n?L(Ht(rd(),`Expected path ${Wn(t.path.slice(0,r+1))} to be an array`),Eo(({dataset:c,addIssue:d})=>{let h=[];for(let y of c.value){let b=rn(a,y);if(b.success)return c.value;h.push(b.issues[0])}return d({...h[0],message:s?h[0].message:`Expected any element in array ${Wn(t.path.slice(0,r+1))} to match sub requirement but none matched: ${h[0].message}`}),c.value})):L(Ht(rd(),`Expected path ${Wn(t.path.slice(0,r+1))} to be an array`),Eo(({addIssue:c,dataset:d,NEVER:h})=>{let y=rn(a,d.value[i]);return y.success?[...d.value.slice(0,i).map(()=>null),y.output]:(c(y.issues[0]),h)}))}return typeof i=="string"?z({[i]:s?u:Ep(t,{...e,index:r+1})},`Expected claim ${Wn(t.path)} to be defined`):L(Ht(rd(),`Expected path ${Wn(t.path.slice(0,r+1))} to be an array`),Eo(({addIssue:a,dataset:c,NEVER:d})=>{let h=c.value.map(y=>rn(s?u:Ep(t,{...e,index:r+1}),y));if(h.every(y=>!y.success)){for(let y of h)for(let b of y.issues)a(b);return d}return h.map(y=>y.success?y.output:null)}))},"getJsonClaimParser"),F8=o((t,e)=>{if(!t.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 r=[],n=[];for(let[u,a]of t.claims.entries()){let c=t.format==="mso_mdoc"?W8(a):Ep(a,{index:0,presentation:e.presentation}),d=rn(c,e.credential.credential_format==="mso_mdoc"?e.credential.namespaces:e.credential.claims);if(d.success)n.push({success:!0,claim_index:u,claim_id:a.id,output:d.output,parser:c});else{let h=td(d.issues);r.push({success:!1,issues:h.nested??h,claim_index:u,claim_id:a.id,output:d.output,parser:c})}}let i=[],s=[];for(let[u,a]of t.claim_sets?.entries()??[[void 0,void 0]]){let c=a?.map(d=>{let h=n.find(y=>y.claim_id===d)??r.find(y=>y.claim_id===d);if(!h)throw new hA({message:`Claim with id '${d}' in query '${t.id}' from claim set with index '${u}' not found in claims of claim`});return h})??[...n,...r];if(c.every(d=>d.success)){let d=c.reduce((h,y)=>Qb(y.output,h),{});s.push({success:!0,claim_set_index:u,output:d,valid_claim_indexes:Hn(c.map(h=>h.claim_index))})}else{let d=r.reduce((h,y)=>Qb(y.issues,h),{});i.push({success:!1,issues:d,claim_set_index:u,failed_claim_indexes:c.filter(h=>!h.success).map(h=>h.claim_index),valid_claim_indexes:Hn(c.filter(h=>h.success).map(h=>h.claim_index))})}}return mA(s)?{success:!0,failed_claim_sets:Hn(i),valid_claim_sets:s,valid_claims:Hn(n.map(({parser:u,...a})=>a)),failed_claims:Hn(r.map(({parser:u,...a})=>a))}:{success:!1,failed_claim_sets:i,failed_claims:r.map(({parser:u,...a})=>a),valid_claims:Hn(n.map(({parser:u,...a})=>a))}},"runClaimsQuery"),r1=o(t=>z({cryptographic_holder_binding:t.require_cryptographic_holder_binding?ge(!0,e=>`Expected cryptographic_holder_binding to be true (because credential query '${t.id}' requires cryptographic holder binding), but received ${e.input}`):jr()}),"getCryptographicHolderBindingValue"),z8=o(t=>{let e=t.meta?.doctype_value?ge(t.meta.doctype_value,r=>`Expected doctype to be '${t.meta?.doctype_value}' but received '${r.input}'`):oe("Expected doctype to be defined");return z({credential_format:ge("mso_mdoc",r=>`Expected credential format to be 'mso_mdoc' but received '${r.input}'`),doctype:e,...r1(t).entries})},"getMdocMetaParser"),dA=o(t=>z({credential_format:ge(t.format,e=>`Expected credential format to be '${t.format}' but received '${e.input}'`),vct:t.meta?.vct_values?sA(Po(t.meta.vct_values,e=>`Expected vct to be '${t.meta?.vct_values?.join("' | '")}' but received '${e.input}'`),e=>`Expected vct to be '${t.meta?.vct_values?.join("' | '")}' but received '${e.input}'`):sA(oe("Expected vct to be a string"),"Expected vct to be defined"),...r1(t).entries}),"getSdJwtVcMetaParser"),lA=o(t=>z({credential_format:ge(t.format,e=>`Expected credential format to be '${t.format}' but received '${e.input}'`),type:t.meta?.type_values?Re(t.meta.type_values.map(e=>M8(e)),`Expected type to include all values from one of the following subsets: ${t.meta.type_values.map(e=>`[${e.join(", ")}]`).join(" | ")}`):ue(oe()),...r1(t).entries}),"getW3cVcMetaParser"),K8=o(t=>{if(t.format==="mso_mdoc")return z8(t);if(t.format==="dc+sd-jwt")return dA(t);if(t.format==="vc+sd-jwt")return t.meta&&"type_values"in t.meta?lA(t):dA(t);if(t.format==="ldp_vc"||t.format==="jwt_vc_json")return lA(t);throw new nn({code:"NOT_IMPLEMENTED",message:`Unsupported format '${t.format}'`})},"getMetaParser"),J8=o((t,e)=>{let r=K8(t),n=rn(r,e);if(!n.success){let i=td(n.issues);return{success:!1,issues:i.nested??i,output:n.output}}return{success:!0,output:n.output}},"runMetaQuery"),G8=o((t,e)=>{if(!t.trusted_authorities)return{success:!0};let r=[];for(let[n,i]of t.trusted_authorities.entries()){let s=H8(i),u=rn(s,e.authority);if(u.success)return{success:!0,valid_trusted_authority:{success:!0,trusted_authority_index:n,output:u.output},failed_trusted_authorities:Hn(r)};let a=td(u.issues);r.push({success:!1,trusted_authority_index:n,issues:a.nested??a,output:u.output})}return{success:!1,failed_trusted_authorities:r}},"runTrustedAuthoritiesQuery"),wA=o((t,e)=>{let{credentials:r,presentation:n}=e,i=[],s=[];for(let[u,a]of r.entries()){let c=G8(t,a),d=F8(t,{credential:a,presentation:n}),h=J8(t,a);d.success&&c.success&&h.success?i.push({success:!0,input_credential_index:u,trusted_authorities:c,meta:h,claims:d}):s.push({success:!1,input_credential_index:u,trusted_authorities:c,meta:h,claims:d})}return mA(i)?{success:!0,credential_query_id:t.id,failed_credentials:Hn(s),valid_credentials:i}:{success:!1,credential_query_id:t.id,failed_credentials:Hn(s),valid_credentials:void 0}},"runCredentialQuery"),sd;(function(t){let e=z({id:L(oe(),ed(yA),X("REQUIRED. A string identifying the Credential in the response and, if provided, the constraints in 'credential_sets'.")),require_cryptographic_holder_binding:L(Y(jr(),!0),X("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:L(Y(jr(),!1),X("OPTIONAL. A boolean which indicates whether multiple Credentials can be returned for this Credential Query. If omitted, the default value is false.")),claim_sets:L(Y(ue(ue(Br))),X("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:L(Y(ue(Jb.vModel)),X("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."))}),r=t.vMdoc=z({...e.entries,format:L(ge("mso_mdoc"),X("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:L(Y(ue(Ca.vMdoc)),X("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:L(Y(z({doctype_value:L(Y(oe()),X("OPTIONAL. String that specifies an allowed value for the doctype of the requested Verifiable Credential."))})),X("OPTIONAL. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))}),n=t.vSdJwtVc=z({...e.entries,format:L(Po(["vc+sd-jwt","dc+sd-jwt"]),X("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:L(Y(ue(Ca.vW3cSdJwtVc)),X("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:L(Y(L(z({vct_values:Y(Ht(oe()))}),X("OPTIONAL. An array of strings that specifies allowed values for the type of the requested Verifiable Credential."))),X("OPTIONAL. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))}),i=t.vW3cVc=z({...e.entries,format:L(Po(["jwt_vc_json","ldp_vc","vc+sd-jwt"]),X("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")),claims:L(Y(ue(Ca.vW3cSdJwtVc)),X("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")),meta:L(L(z({type_values:L(ue(ue(oe())),X("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."))})),X("REQUIRED. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."))});t.vModel=Ln("format",[r,i,n]),t.validate=s=>{X8(s)}})(sd||(sd={}));var X8=o(t=>{if(!t.claim_sets)return;let e=new Set(t.claims?.map(n=>n.id)),r=[];for(let n of t.claim_sets)for(let i of n)e.has(i)||r.push(i);if(r.length>0)throw new B8({message:`Credential set contains undefined credential id${r.length===0?"":"`s"} '${r.join(", ")}'`})},"claimSetIdsAreDefined"),Tp;(function(t){t.vModel=z({options:L(ue(Ht(Br)),X("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:L(Y(jr(),!0),X("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:L(Y(Re([oe(),lt(),Ct(oe(),vr())])),X("OPTIONAL. A string, number or object specifying the purpose of the query."))})})(Tp||(Tp={}));var Ip;(function(t){let e=Re([Da.vModel.entries.namespaces,qa.vModel.entries.claims,Ma.vModel.entries.claims]),r=t.vClaimsEntrySuccessResult=z({success:ge(!0),claim_index:lt(),claim_id:Y(Br),output:e}),n=t.vClaimsEntryFailureResult=z({success:ge(!1),claim_index:lt(),claim_id:Y(Br),issues:Ct(oe(),vr()),output:vr()}),i=t.vClaimSetSuccessResult=z({success:ge(!0),claim_set_index:Re([lt(),Nr()]),valid_claim_indexes:Y(ue(lt())),failed_claim_indexes:Y(Nr()),output:e}),s=t.vClaimSetFailureResult=z({success:ge(!1),claim_set_index:Re([lt(),Nr()]),valid_claim_indexes:Y(ue(lt())),failed_claim_indexes:ue(lt()),issues:Ct(oe(),vr())}),u=t.vClaimsSuccessResult=z({success:ge(!0),valid_claims:Y(ue(r)),failed_claims:Y(ue(n)),valid_claim_sets:ue(i),failed_claim_sets:Y(ue(s))}),a=t.vClaimsFailureResult=z({success:ge(!1),valid_claims:Y(ue(r)),failed_claims:ue(n),valid_claim_sets:Y(Nr()),failed_claim_sets:ue(s)});t.vModel=Re([u,a])})(Ip||(Ip={}));var Op;(function(t){let e=t.vMetaSuccessResult=z({success:ge(!0),output:Ln("credential_format",[Cp(qa.vModel,["credential_format","cryptographic_holder_binding","vct"]),Cp(Da.vModel,["credential_format","cryptographic_holder_binding","doctype"]),Cp(Ma.vModel,["credential_format","cryptographic_holder_binding","type"])])}),r=t.vMetaFailureResult=z({success:ge(!1),issues:Ct(oe(),vr()),output:vr()});t.vModel=Re([e,r])})(Op||(Op={}));var Rp;(function(t){let e=t.vTrustedAuthorityEntrySuccessResult=z({success:ge(!0),trusted_authority_index:lt(),output:Ln("type",Pp.vModel.options.map(s=>z({type:s.entries.type,value:s.entries.values.item})))}),r=t.vTrustedAuthorityEntryFailureResult=z({success:ge(!1),trusted_authority_index:lt(),issues:Ct(oe(),vr()),output:vr()}),n=t.vTrustedAuthoritySuccessResult=Re([z({success:ge(!0),valid_trusted_authority:Y(Nr()),failed_trusted_authorities:Y(Nr())}),z({success:ge(!0),valid_trusted_authority:e,failed_trusted_authorities:Y(ue(r))})]),i=t.vTrustedAuthorityFailureResult=z({success:ge(!1),valid_trusted_authority:Y(Nr()),failed_trusted_authorities:ue(r)});t.vModel=Re([...n.options,i])})(Rp||(Rp={}));var Yb;(function(t){let e=t.vCredentialQueryItemCredentialSuccessResult=z({success:ge(!0),input_credential_index:lt(),trusted_authorities:Rp.vTrustedAuthoritySuccessResult,claims:Ip.vClaimsSuccessResult,meta:Op.vMetaSuccessResult}),r=t.vCredentialQueryItemCredentialFailureResult=z({success:ge(!1),input_credential_index:lt(),trusted_authorities:Rp.vModel,claims:Ip.vModel,meta:Op.vModel}),n=t.vCredentialQueryItemResult=Re([z({success:ge(!0),credential_query_id:Br,valid_credentials:ue(e),failed_credentials:Y(ue(r))}),z({success:ge(!1),credential_query_id:Br,valid_credentials:Y(Nr()),failed_credentials:Y(ue(r))})]),i=t.vCredentialQueryResult=Ct(Br,n);t.vModel=z({credentials:L(ue(sd.vModel),X("REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials.")),credential_matches:i,credential_sets:Y(L(ue(z({...Tp.vModel.entries,matching_options:Re([Nr(),ue(Ht(oe()))])})),X("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:jr()})})(Yb||(Yb={}));var pA;(function(t){let e=t.vModel=oA(Yb.vModel,["credentials"]);t.parse=r=>id(e,r),t.fromDcqlPresentation=(r,n)=>{let{dcqlQuery:i}=n,s=Object.entries(r).map(([a,c])=>{let d=i.credentials.find(h=>h.id===a);if(!d)throw new Kb({message:`Query ${a} not found in the dcql query. Cannot validate presentation.`});if(Array.isArray(c)){if(c.length===0)throw new Kb({message:`Query credential '${a}' is present in the presentations but the value is an empty array. Each entry must at least provide one presentation.`});if(!d.multiple&&c.length>1)throw new Kb({message:`Query credential '${a}' 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 wA(d,{presentation:!0,credentials:c?Array.isArray(c)?c:[c]:[]})}),u=i.credential_sets?.map(a=>{let c=a.options.filter(d=>d.every(h=>s.find(y=>y.credential_query_id===h)?.success));return{...a,matching_options:c.length>0?c:void 0}});return{can_be_satisfied:s.every(a=>a.success&&!a.failed_credentials)&&(u?u.every(a=>!a.required||a.matching_options):i.credentials.every(a=>s.find(c=>c.credential_query_id===a.id)?.success)),credential_sets:u,credential_matches:Object.fromEntries(s.map(a=>[a.credential_query_id,a]))}},t.validate=r=>{if(!r.can_be_satisfied)throw new q8({message:"Invalid Presentation record",cause:r});return r}})(pA||(pA={}));var Z8=o((t,e)=>{let r=Object.fromEntries(t.credentials.map(s=>[s.id,wA(s,e)])),n=t.credential_sets?.map(s=>{let u=s.options.filter(a=>a.every(c=>r[c].success));return{...s,matching_options:u.length>0?u:void 0}}),i=n?n.every(s=>!s.required||s.matching_options):t.credentials.every(({id:s})=>r[s].success===!0);return{...t,can_be_satisfied:i,credential_matches:r,credential_sets:n}},"runDcqlQuery"),To;(function(t){let e=t.vModel=z({credentials:L(ue(sd.vModel),X("REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials.")),credential_sets:L(Y(ue(Tp.vModel)),X("OPTIONAL. A non-empty array of credential set queries that specifies additional constraints on which of the requested Verifiable Credentials to return."))});t.validate=r=>{Q8(r),Y8(r),r.credentials.forEach(sd.validate)},t.query=(r,n)=>Z8(r,{credentials:n,presentation:!1}),t.parse=r=>id(e,r)})(To||(To={}));var Q8=o(t=>{let e=t.credentials.map(n=>n.id),r=e.filter((n,i)=>e.indexOf(n)!==i);if(r.length>0)throw new D8({message:`Duplicate credential query ids found: ${r.join(", ")}`})},"validateUniqueCredentialQueryIds"),Y8=o(t=>{if(!t.credential_sets)return;let e=new Set(t.credentials.map(n=>n.id)),r=[];for(let n of t.credential_sets)for(let i of n.options)for(let s of i)e.has(s)||r.push(s);if(r.length>0)throw new N8({message:`Credential set contains undefined credential id${r.length===1?"":"`s"} '${r.join(", ")}'`})},"validateCredentialSets");var Ni=o(t=>{if(t===null||typeof t!="object"||Array.isArray(t))throw new re("invalid_dcql_query","dcql_query must be a JSON object");let e;try{e=To.parse(t)}catch(r){throw new re("invalid_dcql_query",`dcql_query failed structural validation: ${xA(r)}`,{cause:r})}try{To.validate(e)}catch(r){throw new re("invalid_dcql_query",`dcql_query failed content validation: ${xA(r)}`,{cause:r})}return e},"parseDcqlQuery"),xA=o(t=>t instanceof Error?t.message:String(t),"describe");var o1=class o1 extends Error{constructor(e,r,n){super(r),this.name="RequestObjectError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}};o(o1,"RequestObjectError");var Q=o1,jp=o(async t=>{let e=await eE(t),{header:r,claims:n}=tE(e),i=Et(n.client_id);if(!i)throw new Q("invalid_request_object","Request Object JWS payload is missing client_id");let s=Et(n.client_id_scheme)??t.urlClientIdScheme,{prefix:u,value:a}=_p(i,s);if(t.urlClientId&&t.urlClientId!==i)throw new Q("client_id_mismatch",`Outer URL client_id (${t.urlClientId}) does not match signed Request Object client_id (${i})`);if(t.unsafeSkipRequestObjectSignatureVerification)return kA(i,u,n);switch(u){case"redirect_uri":throw new Q("unsupported_client_id_scheme","client-id prefix=redirect_uri does not permit signed Request Objects (OID4VP \xA75)");case"did":await rE({jws:e,header:r,clientId:a,opts:t});break;case"x509_san_dns":await iE({jws:e,header:r,clientId:a,opts:t});break;case"pre-registered":await cE({jws:e,header:r,clientId:a,opts:t});break;case"https":case"verifier_attestation":case"x509_hash":throw new Q("unsupported_client_id_scheme",`client-id prefix=${u} is not yet supported (supported: did, x509_san_dns, pre-registered)`);default:{let c=u;throw new Q("unsupported_client_id_scheme",`client-id prefix=${c} is not supported`)}}return kA(i,u,n)},"verifyAndDecodeRequestObject"),eE=o(async t=>{if(t.inlineJwt){if(!EA(t.inlineJwt))throw new Q("invalid_request_object","Inline `request` parameter is not a compact JWS");return t.inlineJwt}if(!t.requestUri)throw new Q("invalid_request_object","verifyAndDecodeRequestObject requires either inlineJwt or requestUri");let e=t.fetchImpl??globalThis.fetch;if(typeof e!="function")throw new Q("request_fetch_failed","No fetch implementation available to resolve request_uri");let r;try{r=await e(t.requestUri,{method:"GET"})}catch(i){throw new Q("request_fetch_failed",`Failed to fetch request_uri: ${Zt(i)}`,{cause:i})}if(!r.ok)throw new Q("request_fetch_failed",`request_uri returned ${r.status} ${r.statusText}`);let n=(await r.text()).trim();if(!EA(n))throw new Q("invalid_request_object","request_uri response is not a compact JWS");return n},"loadJws"),tE=o(t=>{let[e,r]=t.split(".");try{let n=JSON.parse(PA(e)),i=JSON.parse(PA(r));return{header:n,claims:i}}catch(n){throw new Q("invalid_request_object",`Failed to decode Request Object JWS: ${Zt(n)}`,{cause:n})}},"decodeHeaderAndClaims"),rE=o(async t=>{let{jws:e,header:r,clientId:n,opts:i}=t,s=Et(r.kid);if(!s)throw new Q("invalid_request_object","Request Object JWS header is missing kid (required for client_id_scheme=did)");let u=n.split("#")[0],a=i.didResolver??i1(i.fetchImpl),c;try{c=await a(u)}catch(b){throw new Q("did_resolution_failed",`Failed to resolve ${u}: ${Zt(b)}`,{cause:b})}let d=nE(c,s);if(!d)throw new Q("request_signer_untrusted",`Verification method ${s} not found on ${u}`);if(!d.publicKeyJwk)throw new Q("request_signer_untrusted",`Verification method ${d.id} has no publicKeyJwk (publicKeyMultibase not supported by default resolver)`);let h=Et(r.alg);if(!h)throw new Q("invalid_request_object","Request Object JWS header is missing alg");let y;try{y=await dn(d.publicKeyJwk,h)}catch(b){throw new Q("request_signer_untrusted",`Failed to import publicKeyJwk from ${d.id}: ${Zt(b)}`,{cause:b})}try{await ac(e,y)}catch(b){throw new Q("request_signature_invalid",`JWS signature verification failed: ${Zt(b)}`,{cause:b})}},"verifyWithDid"),nE=o((t,e)=>{let r=[];for(let i of t.verificationMethod??[])r.push(i);for(let i of t.authentication??[])typeof i=="object"&&r.push(i);for(let i of t.assertionMethod??[])typeof i=="object"&&r.push(i);let n=e.includes("#")?e.split("#").pop():e;return r.find(i=>i.id===e||i.id.split("#").pop()===n)},"findVerificationMethod"),iE=o(async t=>{let{jws:e,header:r,clientId:n,opts:i}=t,s=r.x5c;if(!Array.isArray(s)||s.length===0)throw new Q("invalid_request_object","Request Object JWS header is missing x5c (required for client_id_scheme=x509_san_dns)");let u;try{u=oE(s)}catch(A){throw new Q("invalid_request_object",`Failed to parse x5c chain: ${Zt(A)}`,{cause:A})}let a=u[0],c=fE(n);if(!uE(a,c))throw new Q("client_id_mismatch",`Leaf certificate SAN does not cover client_id host "${c}" (sanDnsNames=${TA(a).join(",")||"none"})`);let d=i.trustedX509Roots??[],h=!!i.unsafeAllowSelfSigned;if(d.length===0&&!h)throw new Q("request_signer_untrusted","client_id_scheme=x509_san_dns requires trustedX509Roots (or unsafeAllowSelfSigned for dev)");d.length>0&&await sE(u,d);let y=n1(s[0]),b;try{b=await Od(y,Et(r.alg)??"RS256")}catch(A){throw new Q("request_signer_untrusted",`Failed to import leaf X.509 cert: ${Zt(A)}`,{cause:A})}try{await ac(e,b)}catch(A){throw new Q("request_signature_invalid",`JWS signature verification failed: ${Zt(A)}`,{cause:A})}},"verifyWithX509"),oE=o(t=>t.map(e=>new Sa(n1(e))),"buildCertChain"),sE=o(async(t,e)=>{let r=e.map(i=>new Sa(i));for(let i=0;i<t.length-1;i++){let s=t[i],u=t[i+1];if(!await AA(s,u))throw new Q("request_signer_untrusted",`x5c chain broken at position ${i}: cert is not signed by its successor`)}let n=t[t.length-1];if(t.length===1){let i=await SA(n);for(let s of r)if(await SA(s)===i)return;throw new Q("request_signer_untrusted","Leaf certificate is self-contained and does not match any trustedX509Roots")}for(let i of r)if(await AA(n,i))return;throw new Q("request_signer_untrusted","Top of x5c chain is not rooted in any trustedX509Roots")},"verifyChainToTrustedRoots"),AA=o(async(t,e)=>{try{return await t.verify({publicKey:e.publicKey})}catch{return!1}},"safeVerify"),SA=o(async t=>{let e=await t.getThumbprint("SHA-256"),r=new Uint8Array(e),n="";for(let i=0;i<r.length;i++)n+=r[i].toString(16).padStart(2,"0");return n},"fingerprintHex"),uE=o((t,e)=>{let r=e.toLowerCase();for(let n of TA(t))if(aE(n,r))return!0;return!1},"leafCoversHost"),TA=o(t=>{let e=t.getExtension(_a);return e?e.names.toJSON().filter(r=>r.type==="dns").map(r=>r.value):[]},"listLeafSanDnsNames"),aE=o((t,e)=>{let r=t.toLowerCase();if(r===e)return!0;if(!r.startsWith("*."))return!1;let n=r.slice(1);if(!e.endsWith(n))return!1;let i=e.slice(0,-n.length);return i.length>0&&!i.includes(".")},"matchesDnsName");var n1=o(t=>{let e=t.replace(/\s+/g,"");return`-----BEGIN CERTIFICATE-----
|
|
21
26
|
${(e.match(/.{1,64}/g)??[e]).join(`
|
|
22
27
|
`)}
|
|
23
28
|
-----END CERTIFICATE-----
|
|
24
|
-
`},"derToPem"),NC=o(async t=>{let{jws:e,header:r,opts:n}=t;if(!!!n.unsafeAllowSelfSigned)throw new Z("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 s=r.x5c;if(!Array.isArray(s)||s.length===0)throw new Z("invalid_request_object","client-id prefix=pre-registered requires an x5c header to verify the signature against (no key material available otherwise)");let u=kb(s[0]),a;try{a=await pd(u,bt(r.alg)??"RS256")}catch(c){throw new Z("request_signer_untrusted",`Failed to import leaf X.509 cert: ${$t(c)}`,{cause:c})}try{await za(e,a)}catch(c){throw new Z("request_signature_invalid",`JWS signature verification failed: ${$t(c)}`,{cause:c})}},"verifyWithPreRegistered"),BC=o(t=>{try{return new URL(t.includes("://")?t:`https://${t}`).hostname}catch{return t}},"hostFromClientId"),Cb=o((t=globalThis.fetch)=>async e=>{if(e.startsWith("did:jwk:"))return DC(e);if(e.startsWith("did:web:"))return qC(e,t);throw new Z("did_resolution_failed",`Built-in resolver does not support ${e.split(":").slice(0,2).join(":")} \u2014 pass a custom didResolver`)},"builtInDidResolver"),DC=o(t=>{let e=t.replace(/^did:jwk:/,"").split("#")[0],r;try{let i="=".repeat((4-e.length%4)%4),s=e.replace(/-/g,"+").replace(/_/g,"/")+i;r=JSON.parse(Buffer.from(s,"base64").toString("utf8"))}catch(i){throw new Z("did_resolution_failed",`Failed to decode did:jwk identifier: ${$t(i)}`,{cause:i})}let n=`${t}#0`;return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:r}],authentication:[n],assertionMethod:[n]}},"resolveDidJwk"),qC=o(async(t,e)=>{if(typeof e!="function")throw new Z("did_resolution_failed","did:web resolution requires a fetch implementation");let n=t.replace(/^did:web:/,"").split(":").map(d=>decodeURIComponent(d)),i=n.shift(),s=n.length===0?"/.well-known/did.json":`/${n.join("/")}/did.json`,u=`https://${i}${s}`,a;try{a=await e(u,{method:"GET"})}catch(d){throw new Z("did_resolution_failed",`Failed to fetch ${u}: ${$t(d)}`,{cause:d})}if(!a.ok)throw new Z("did_resolution_failed",`${u} returned ${a.status} ${a.statusText}`);let c;try{c=await a.json()}catch(d){throw new Z("did_resolution_failed",`${u} response was not JSON: ${$t(d)}`,{cause:d})}if(!c||typeof c!="object"||Array.isArray(c))throw new Z("did_resolution_failed",`${u} response was not a DID Document object`);return c},"resolveDidWeb"),Vx=o((t,e,r)=>{let n=Hx(r.presentation_definition)?r.presentation_definition:void 0,i=bt(r.presentation_definition_uri),s;if(r.dcql_query!==void 0&&r.dcql_query!==null){if(n||i)throw new te("both_pex_and_dcql","Request Object claims carry both PEX (presentation_definition[_uri]) and DCQL (dcql_query); OID4VP 1.0 \xA75.3 forbids this");s=ai(r.dcql_query)}let u=Hx(r.client_metadata)?r.client_metadata:void 0;return{client_id:t,client_id_scheme:e,response_type:bt(r.response_type)??"vp_token",response_mode:bt(r.response_mode),response_uri:bt(r.response_uri),redirect_uri:bt(r.redirect_uri),nonce:bt(r.nonce)??"",state:bt(r.state),presentation_definition:n,presentation_definition_uri:i,dcql_query:s,client_metadata:u,client_metadata_uri:bt(r.client_metadata_uri),scope:bt(r.scope)}},"buildRequestFromClaims"),bt=o(t=>typeof t=="string"&&t.length>0?t:void 0,"asString"),Hx=o(t=>t!==null&&typeof t=="object"&&!Array.isArray(t),"isObject"),Lx=o(t=>/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t),"looksLikeJws"),Wx=o(t=>{let e="=".repeat((4-t.length%4)%4),r=t.replace(/-/g,"+").replace(/_/g,"/")+e;return Buffer.from(r,"base64").toString("utf8")},"b64urlDecode"),$t=o(t=>t instanceof Error?t.message:String(t),"describe");var Lf=o(t=>{if(typeof t!="string"||t.trim().length===0)throw new te("invalid_uri","Authorization Request URI must be a non-empty string");let e=MC(t),r=e.get("request_uri");if(typeof r=="string"&&r.length>0){if(!Jx(r))throw new te("invalid_uri","request_uri must be an absolute https:// URL");return{kind:"by_reference_request_uri",requestUri:r,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:UC(e)}},"parseAuthorizationRequestUri"),Pb=o(async(t,e=globalThis.fetch)=>{if(typeof e!="function")throw new te("presentation_definition_fetch_failed","No fetch implementation available to resolve presentation_definition_uri");if(!Jx(t))throw new te("invalid_uri","presentation_definition_uri must be an absolute https:// URL");let r;try{r=await e(t,{method:"GET"})}catch(i){throw new te("presentation_definition_fetch_failed",`Failed to fetch presentation_definition_uri: ${$C(i)}`,{cause:i})}if(!r.ok)throw new te("presentation_definition_fetch_failed",`presentation_definition_uri returned ${r.status} ${r.statusText}`);let n;try{n=await r.json()}catch(i){throw new te("invalid_json","presentation_definition_uri response was not valid JSON",{cause:i})}return Kx(n)},"resolvePresentationDefinitionByReference"),Wf=o(async(t,e=globalThis.fetch,r={})=>{let n=Lf(t),i;if(n.kind==="by_value")i=n.request;else{let s=n.rawParams.get("client_id")??void 0,u=n.rawParams.get("client_id_scheme")??void 0;i=await lp({requestUri:n.kind==="by_reference_request_uri"?n.requestUri:void 0,inlineJwt:n.kind==="by_reference_request_jwt"?n.jwt:void 0,urlClientId:s,urlClientIdScheme:u,fetchImpl:e,didResolver:r.didResolver,trustedX509Roots:r.trustedX509Roots,unsafeAllowSelfSigned:r.unsafeAllowSelfSigned,unsafeSkipRequestObjectSignatureVerification:r.unsafeSkipRequestObjectSignatureVerification})}if(i.presentation_definition)return i;if(i.presentation_definition_uri){let s=await Pb(i.presentation_definition_uri,e);return{...i,presentation_definition:s}}return i},"resolveAuthorizationRequest"),MC=o(t=>{let e=t.indexOf("?");if(e!==-1)return new URLSearchParams(t.slice(e+1));if(t.includes("://")||/^[a-z][a-z0-9+.-]*:/i.test(t))throw new te("invalid_uri","Authorization Request URI has no query string");if(t.includes("="))return new URLSearchParams(t);throw new te("invalid_uri","Authorization Request URI has no query string")},"extractSearchParams"),UC=o(t=>{let e=t.get("client_id");if(!e)throw new te("missing_client_id","Authorization Request is missing client_id");let r=t.get("nonce");if(!r)throw new te("missing_nonce","Authorization Request is missing nonce");let n=t.get("response_type");if(!n)throw new te("missing_response_type","Authorization Request is missing response_type");let i=n.split(/\s+/).filter(Boolean),s=new Set(["vp_token","id_token"]);if(!i.some(Y=>s.has(Y)))throw new te("unsupported_response_type",`Authorization Request response_type "${n}" is not supported (expected vp_token and/or id_token)`);let u=t.get("response_uri")??void 0,a=t.get("redirect_uri")??void 0,c=t.get("response_mode")??void 0;if(!u&&!a)throw new te("missing_response_target","Authorization Request is missing both response_uri and redirect_uri");let d=t.get("presentation_definition"),p=t.get("presentation_definition_uri"),y=t.get("dcql_query");if(d&&p)throw new te("both_definition_and_uri","Authorization Request has both presentation_definition and presentation_definition_uri");if(y&&(d||p))throw new te("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(d){let Y;try{Y=JSON.parse(d)}catch(ye){throw new te("invalid_json","presentation_definition query parameter was not valid JSON",{cause:ye})}v=Kx(Y)}let x;if(y){let Y;try{Y=JSON.parse(y)}catch(ye){throw new te("invalid_json","dcql_query query parameter was not valid JSON",{cause:ye})}x=ai(Y)}let A=t.get("scope")??void 0;if(i.includes("vp_token")&&!v&&!p&&!x&&!A)throw new te("missing_presentation_definition","Authorization Request has none of presentation_definition, presentation_definition_uri, dcql_query, or scope");let I=t.get("client_metadata"),J;if(I)try{let Y=JSON.parse(I);if(Y&&typeof Y=="object"&&!Array.isArray(Y))J=Y;else throw new te("invalid_json","client_metadata query parameter must be a JSON object")}catch(Y){throw Y instanceof te?Y:new te("invalid_json","client_metadata query parameter was not valid JSON",{cause:Y})}let de=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"]),fe={};t.forEach((Y,ye)=>{de.has(ye)||(fe[ye]=Y)});let{prefix:ve}=ep(e,t.get("client_id_scheme")??void 0);return{client_id:e,client_id_scheme:ve,response_type:n,response_mode:c,response_uri:u,redirect_uri:a,nonce:r,state:t.get("state")??void 0,presentation_definition:v,presentation_definition_uri:p??void 0,dcql_query:x,client_metadata:J,client_metadata_uri:t.get("client_metadata_uri")??void 0,scope:A,...Object.keys(fe).length>0?{extra:fe}:{}}},"buildRequestFromParams"),Kx=o(t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new te("invalid_presentation_definition","presentation_definition must be a JSON object");let e=t;if(typeof e.id!="string"||e.id.length===0)throw new te("invalid_presentation_definition","presentation_definition is missing a string `id`");if(!Array.isArray(e.input_descriptors)||e.input_descriptors.length===0)throw new te("invalid_presentation_definition","presentation_definition must declare a non-empty input_descriptors array");for(let[r,n]of e.input_descriptors.entries()){if(!n||typeof n!="object")throw new te("invalid_presentation_definition",`input_descriptors[${r}] must be an object`);let i=n;if(typeof i.id!="string"||i.id.length===0)throw new te("invalid_presentation_definition",`input_descriptors[${r}].id must be a non-empty string`);if(!i.constraints||typeof i.constraints!="object")throw new te("invalid_presentation_definition",`input_descriptors[${r}].constraints must be an object`)}return e},"validatePresentationDefinition"),Jx=o(t=>{try{return new URL(t).protocol==="https:"}catch{return!1}},"isHttpsUrl"),$C=o(t=>t instanceof Error?t.message:String(t),"describe");var b4=kr(y4());var C6=512,u1=o((t,e)=>{if(!Array.isArray(e.path)||e.path.length===0)return{matched:!1,reason:"Field has no `path[]` declared"};for(let r of e.path){let n;try{n=a1(t,r)}catch(i){return{matched:!1,reason:`JSONPath "${r}" could not be evaluated: ${R6(i)}`}}if(n.length!==0)for(let i of n){if(!e.filter)return{matched:!0,matchedPath:r,value:i};if(Ta(i,e.filter))return{matched:!0,matchedPath:r,value:i};if(Array.isArray(i)&&T6(e.filter)){for(let s of i)if(Ta(s,e.filter))return{matched:!0,matchedPath:r,value:s}}}}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"),Np=o((t,e)=>{let n=e.constraints?.fields??[],i=[];for(let s of n){let u=u1(t,s);if(i.push(u),!u.matched)return{matched:!1,descriptorId:e.id,fields:i,reason:u.reason}}return{matched:!0,descriptorId:e.id,fields:i}},"matchInputDescriptor"),a1=o((t,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 r=P6(e),n=[t];for(let i of r){let s=[];for(let u of n)switch(i.kind){case"property":{let a=E6(u,i.name);a!==void 0&&s.push(a);break}case"index":{Array.isArray(u)&&i.index<u.length&&s.push(u[i.index]);break}case"wildcard":{if(Array.isArray(u))for(let a of u)s.push(a);else if(u&&typeof u=="object")for(let a of Object.values(u))s.push(a);break}case"descendant":{s1(u,i.name,s);break}}n=s}return n},"queryJsonPath"),E6=o((t,e)=>{if(t!=null&&!Array.isArray(t)&&typeof t=="object")return t[e]},"getProperty"),s1=o((t,e,r)=>{if(t!=null){if(Array.isArray(t)){for(let n of t)s1(n,e,r);return}if(typeof t=="object"){let n=t;for(let[i,s]of Object.entries(n))i===e&&r.push(s),s1(s,e,r)}}},"collectDescendants"),P6=o(t=>{let e=[],r=t.startsWith("$")?1:0;for(;r<t.length;){let n=t[r];if(n===".")if(t[r+1]==="."){r+=2;let i=m4(t,r);if(!i.text)throw new Error(`Recursive descent ".." at position ${r} must be followed by a property name`);e.push({kind:"descendant",name:i.text}),r=i.next}else{if(r+=1,t[r]==="*"){e.push({kind:"wildcard"}),r+=1;continue}let i=m4(t,r);if(!i.text)throw new Error(`Property accessor "." at position ${r} must be followed by an identifier`);e.push({kind:"property",name:i.text}),r=i.next}else if(n==="["){let i=t.indexOf("]",r+1);if(i===-1)throw new Error(`Unterminated "[" in JSONPath "${t}"`);let s=t.slice(r+1,i).trim();if(s==="*")e.push({kind:"wildcard"});else if(/^-?\d+$/.test(s))e.push({kind:"index",index:parseInt(s,10)});else if(/^'[^']*'$/.test(s)||/^"[^"]*"$/.test(s))e.push({kind:"property",name:s.slice(1,-1)});else throw new Error(`Unsupported bracket expression [${s}] in JSONPath "${t}"`);r=i+1}else throw new Error(`Unexpected character "${n}" at position ${r} in JSONPath "${t}"`)}return e},"tokenizeJsonPath"),m4=o((t,e)=>{let r=e;for(;r<t.length;){let n=t[r];if(!/[A-Za-z0-9_\-@:]/.test(n))break;r+=1}return{text:t.slice(e,r),next:r}},"readIdentifier"),Ta=o((t,e)=>{if("type"in e&&!(Array.isArray(e.type)?e.type:[e.type]).some(i=>O6(t,i))||"const"in e&&!jp(t,e.const))return!1;if("enum"in e){let r=e.enum;if(!Array.isArray(r)||!r.some(n=>jp(t,n)))return!1}if("pattern"in e){if(typeof t!="string")return!1;let r=e.pattern;if(typeof r!="string"||r.length>C6||!(0,b4.default)(r))return!1;let n;try{n=new RegExp(r)}catch{return!1}try{if(!n.test(t))return!1}catch{return!1}}if(typeof t=="number"&&(typeof e.minimum=="number"&&t<e.minimum||typeof e.maximum=="number"&&t>e.maximum||typeof e.exclusiveMinimum=="number"&&t<=e.exclusiveMinimum||typeof e.exclusiveMaximum=="number"&&t>=e.exclusiveMaximum)||typeof t=="string"&&(typeof e.minLength=="number"&&t.length<e.minLength||typeof e.maxLength=="number"&&t.length>e.maxLength))return!1;if(Array.isArray(t)){if(e.contains&&typeof e.contains=="object"){let r=e.contains;if(!t.some(i=>Ta(i,r)))return!1}if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items)){let r=e.items;if(!t.every(i=>Ta(i,r)))return!1}if(typeof e.minItems=="number"&&t.length<e.minItems||typeof e.maxItems=="number"&&t.length>e.maxItems)return!1}return!0},"satisfiesFilter"),T6=o(t=>{if(v4(t,["contains","items","minItems","maxItems"]))return!1;if("type"in t){let e=Array.isArray(t.type)?t.type:[t.type];return e.length===0?!1:e.every(r=>typeof r=="string"&&I6.has(r))}return v4(t,["pattern","minLength","maxLength","minimum","maximum","exclusiveMinimum","exclusiveMaximum"])||"const"in t&&g4(t.const)?!0:"enum"in t&&Array.isArray(t.enum)&&t.enum.length>0?t.enum.every(g4):!1},"expectsPrimitive"),I6=new Set(["string","number","integer","boolean","null"]),g4=o(t=>t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean","isPrimitiveValue"),v4=o((t,e)=>e.some(r=>r in t),"hasAnyKeyword"),O6=o((t,e)=>{switch(e){case"string":return typeof t=="string";case"number":return typeof t=="number";case"integer":return typeof t=="number"&&Number.isInteger(t);case"boolean":return typeof t=="boolean";case"null":return t===null;case"array":return Array.isArray(t);case"object":return t!==null&&typeof t=="object"&&!Array.isArray(t);default:return!1}},"matchesType"),jp=o((t,e)=>{if(t===e)return!0;if(t===null||e===null)return t===e;if(typeof t!=typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!jp(t[r],e[r]))return!1;return!0}if(typeof t=="object"){if(typeof e!="object"||Array.isArray(e))return!1;let r=t,n=e,i=Object.keys(r),s=Object.keys(n);if(i.length!==s.length)return!1;for(let u of i)if(!jp(r[u],n[u]))return!1;return!0}return!1},"deepEqual"),R6=o(t=>t instanceof Error?t.message:String(t),"describe");var Bp=o((t,e)=>{let r=t.map((u,a)=>({index:a,candidate:{...u,format:u.format??Zf(u.credential)}})),n=e.input_descriptors.map(u=>{let a=[],c=u.format??e.format;for(let d of r){let{candidate:p,index:y}=d;if(c&&!N6(p.format,c))continue;let v=B6(p),x=Np(v,u);x.matched&&a.push({descriptorId:u.id,candidate:p,match:x,candidateIndex:y})}return{descriptorId:u.id,candidates:a,reason:a.length===0?q6(u,r.length,c):void 0}}),i=new Set(n.filter(u=>u.candidates.length>0).map(u=>u.descriptorId)),s=j6(e,i);return{descriptors:n,canSatisfy:s.satisfied,reason:s.satisfied?void 0:s.reason}},"selectCredentials"),x4=o((t,e,r={})=>{let n=r.makeId??M6;return{id:r.submissionId??n(),definition_id:t.id,descriptor_map:e.map(i=>{let s={id:i.descriptorId,format:i.format,path:i.path};return i.pathNested&&(s.path_nested={id:i.descriptorId,format:i.format,path:i.pathNested}),s})}},"buildPresentationSubmission"),Zf=o(t=>{if(typeof t=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t)?"jwt_vc_json":void 0;if(!t||typeof t!="object")return;let r=t.proof;if(r&&typeof r=="object"){if(typeof r.jwt=="string"||r.type==="JwtProof2020")return"jwt_vc_json";if(typeof r.type=="string")return"ldp_vc"}},"inferCredentialFormat"),j6=o((t,e)=>{let r=t.submission_requirements;if(!r||r.length===0){let n=t.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 r){let i=A4(n,t,e);if(!i.satisfied)return i}return{satisfied:!0}},"evaluateSubmissionRequirements"),A4=o((t,e,r)=>{if(typeof t.from=="string"&&t.from.length>0){let n=e.input_descriptors.filter(s=>s.group?.includes(t.from));if(n.length===0)return{satisfied:!1,reason:`submission_requirement references unknown group "${t.from}"`};let i=n.filter(s=>r.has(s.id));return w4(t,i.length,n.length)}if(Array.isArray(t.from_nested)&&t.from_nested.length>0){let n=0;for(let i of t.from_nested)A4(i,e,r).satisfied&&(n+=1);return w4(t,n,t.from_nested.length)}return{satisfied:!1,reason:"submission_requirement has neither `from` nor `from_nested`"}},"evaluateRequirement"),w4=o((t,e,r)=>{let n=t.name??t.from??"<anonymous>";return t.rule==="all"?e>=r?{satisfied:!0}:{satisfied:!1,reason:`Requirement "${n}" (rule=all) needs ${r} matches, only ${e} available`}:t.rule==="pick"?typeof t.count=="number"&&e<t.count?{satisfied:!1,reason:`Requirement "${n}" (rule=pick) needs count=${t.count} matches, only ${e} available`}:typeof t.min=="number"&&e<t.min?{satisfied:!1,reason:`Requirement "${n}" (rule=pick) needs min=${t.min} matches, only ${e} available`}:t.count===void 0&&t.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 "${t.rule}"`}},"applyRule"),N6=o((t,e)=>t?Object.prototype.hasOwnProperty.call(e,t):!1,"formatIsPermitted"),B6=o(t=>{let{credential:e,format:r}=t;if(r==="jwt_vc_json"){if(typeof e=="string"){let n=_4(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 s=_4(i);if(s)return s}}}}return e},"decodeCandidateForMatching"),_4=o(t=>{let e=t.split(".");if(e.length===3)try{return JSON.parse(D6(e[1]))}catch{return}},"decodeJwtVc"),D6=o(t=>{let r=(t+"=".repeat((4-t.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/");return typeof atob=="function"?atob(r):Buffer.from(r,"base64").toString("binary")},"base64UrlDecode"),q6=o((t,e,r)=>{if(e===0)return"You have no credentials in your wallet yet";let n=t.name??t.id;if(r){let i=Object.keys(r).join(", ");return`No credential satisfies "${n}" (required format: ${i})`}return`No credential satisfies "${n}"`},"explainNoMatches"),M6=o(()=>{let t=typeof globalThis<"u"&&"crypto"in globalThis?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function"){let e=new Uint8Array(8);return t.getRandomValues(e),Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,18)},"defaultMakeId");var c1=class c1 extends Error{constructor(e,r){super(r),this.name="BuildPresentationError",this.code=e}};o(c1,"BuildPresentationError");var fi=c1,Qf=o(t=>{let{pd:e,chosen:r,holder:n}=t;if(!r||r.length===0)throw new fi("no_selections","buildPresentation requires at least one chosen credential");let i=new Set(e.input_descriptors.map(p=>p.id)),s=r.map((p,y)=>{if(!i.has(p.descriptorId))throw new fi("unknown_descriptor",`Chosen credential at index ${y} references unknown descriptor "${p.descriptorId}"`);return{descriptorId:p.descriptorId,...U6(p.candidate,y)}}),u=t.envelopeFormat??V6(e,s.map(p=>p.format)),a=t.makeId??F6,c={"@context":["https://www.w3.org/2018/credentials/v1"],id:t.presentationId??`urn:uuid:${K6(a)}`,type:["VerifiablePresentation"],holder:n,verifiableCredential:s.map(p=>p.credential)},d={id:t.submissionId??a(),definition_id:e.id,descriptor_map:s.map((p,y)=>({id:p.descriptorId,format:p.format,path:W6(y,u)}))};return{unsignedVp:c,submission:d,vpFormat:u,innerFormats:s.map(p=>p.format)}},"buildPresentation"),U6=o((t,e)=>{let r=t.format??Zf(t.credential);if(!r)throw new fi("unknown_credential_format",`Chosen credential at index ${e} has no detectable format (provide candidate.format or a shape inferCredentialFormat recognizes)`);if(r==="jwt_vc_json"){let n=$6(t.credential);if(!n)throw new fi("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:r}}return{credential:t.credential,format:r}},"normalizeForEmbedding"),$6=o(t=>{if(typeof t=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t)?t:void 0;if(t&&typeof t=="object"){let e=t.proof;if(e&&typeof e=="object"){let r=e.jwt;if(typeof r=="string")return r}}},"extractCompactJws"),V6=o((t,e)=>{let r=H6(t.format),n=L6(e);return r.has("jwt_vp_json")&&!r.has("ldp_vp")?"jwt_vp_json":r.has("ldp_vp")&&!r.has("jwt_vp_json")?"ldp_vp":(r.has("jwt_vp_json")&&r.has("ldp_vp"),n)},"inferEnvelopeFormat"),H6=o(t=>{let e=new Set;return t&&("jwt_vp_json"in t&&e.add("jwt_vp_json"),"ldp_vp"in t&&e.add("ldp_vp")),e},"vpFormatsFromDesignation"),L6=o(t=>t.length===0?"ldp_vp":t.every(r=>r==="jwt_vc_json")?"jwt_vp_json":"ldp_vp","homogeneousVpFormatFromInner"),W6=o((t,e)=>e==="jwt_vp_json"?`$.vp.verifiableCredential[${t}]`:`$.verifiableCredential[${t}]`,"pathForIndex"),F6=o(()=>{let t=typeof globalThis<"u"&&"crypto"in globalThis?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function"){let e=new Uint8Array(8);return t.getRandomValues(e),Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,18)},"defaultMakeId"),K6=o(t=>{let r=(t().replace(/[^0-9a-f]/gi,"")+"0".repeat(32)).slice(0,32);return[r.slice(0,8),r.slice(8,12),"4"+r.slice(13,16),(parseInt(r.charAt(16),16)&3|8).toString(16)+r.slice(17,20),r.slice(20,32)].join("-")},"makeUuidV4");var f1=class f1 extends Error{constructor(e,r,n){super(r),this.name="VpSignError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}};o(f1,"VpSignError");var Lt=f1,di=o(async(t,e)=>(J6(t),t.vpFormat==="jwt_vp_json"?z6(t,e):G6(t,e)),"signPresentation"),J6=o(t=>{let{unsignedVp:e,holder:r,audience:n,nonce:i}=t;if(!e||typeof e!="object")throw new Lt("invalid_input","signPresentation requires an unsignedVp object");if(typeof n!="string"||n.length===0)throw new Lt("invalid_input","signPresentation requires a non-empty `audience`");if(typeof i!="string"||i.length===0)throw new Lt("invalid_input","signPresentation requires a non-empty `nonce`");if(typeof r!="string"||r.length===0)throw new Lt("invalid_input","signPresentation requires a non-empty `holder`");if(e.holder!==void 0&&e.holder!==r)throw new Lt("holder_mismatch",`unsignedVp.holder (${e.holder}) does not match options.holder (${r})`)},"validateInput"),z6=o(async(t,e)=>{if(!e.jwtSigner)throw new Lt("missing_jwt_signer","vpFormat=jwt_vp_json requires helpers.jwtSigner");let r=t.iat??Math.floor(Date.now()/1e3),n={alg:e.jwtSigner.alg,kid:e.jwtSigner.kid,typ:"JWT"},i=t.jti??(typeof t.unsignedVp.id=="string"?t.unsignedVp.id:void 0),s={iss:t.holder,sub:t.holder,aud:t.audience,nonce:t.nonce,iat:r,vp:t.unsignedVp};i&&(s.jti=i);let u;try{u=await e.jwtSigner.sign(n,s)}catch(a){throw new Lt("jwt_sign_failed",`Failed to sign jwt_vp_json: ${a instanceof Error?a.message:String(a)}`,{cause:a})}return{vpToken:u,vpFormat:"jwt_vp_json"}},"signJwtVp"),G6=o(async(t,e)=>{if(!e.ldpVpSigner)throw new Lt("missing_ldp_signer","vpFormat=ldp_vp requires helpers.ldpVpSigner");let r;try{r=await e.ldpVpSigner.sign(t.unsignedVp,{domain:t.audience,challenge:t.nonce})}catch(n){throw new Lt("ldp_sign_failed",`Failed to sign ldp_vp: ${n instanceof Error?n.message:String(n)}`,{cause:n})}return{vpToken:r,vpFormat:"ldp_vp"}},"signLdpVp");var p1=class p1 extends Error{constructor(e,r,n={}){super(r),this.name="JarmEncryptError",this.code=e,n.cause!==void 0&&(this.cause=n.cause)}};o(p1,"JarmEncryptError");var ze=p1,d1="ECDH-ES",l1="A256GCM",Dp=o(async t=>{let{payload:e,clientMetadata:r,verifierNonce:n,walletNonce:i,signer:s}=t,u=r.authorization_encrypted_response_alg??d1,a=r.authorization_encrypted_response_enc??l1,c=r.authorization_signed_response_alg,d=await X6(r,t.fetchImpl),p=Z6(d,u),y,v;if(c){if(!s)throw new ze("missing_signer",`Verifier requires authorization_signed_response_alg=${c} but no wallet signer was supplied`);let I=await Q6(e,c,s);y=new TextEncoder().encode(I),v="JWT"}else y=new TextEncoder().encode(JSON.stringify(e)),v=void 0;let x;try{x=await Xr(p,u)}catch(I){throw new ze("unsupported_alg",`Failed to import verifier encryption key (alg=${u}, kty=${p.kty}): ${Yf(I)}`,{cause:I})}let A={alg:u,enc:a};typeof p.kid=="string"&&p.kid.length>0&&(A.kid=p.kid),v&&(A.cty=v);let B={apv:new TextEncoder().encode(n)};typeof i=="string"&&i.length>0&&(B.apu=new TextEncoder().encode(i));try{return await new Ga(y).setProtectedHeader(A).setKeyManagementParameters(B).encrypt(x)}catch(I){throw new ze("encrypt_failed",`JWE encryption failed (alg=${u}, enc=${a}): ${Yf(I)}`,{cause:I})}},"encryptResponseObject"),X6=o(async(t,e)=>{if(t.jwks&&Array.isArray(t.jwks.keys))return t.jwks.keys;if(typeof t.jwks_uri=="string"&&t.jwks_uri.length>0){let r=e??globalThis.fetch;if(typeof r!="function")throw new ze("jwks_fetch_failed",`client_metadata.jwks_uri=${t.jwks_uri} but no fetch implementation is available`);let n;try{n=await r(t.jwks_uri,{headers:{Accept:"application/json"}})}catch(s){throw new ze("jwks_fetch_failed",`Failed to fetch jwks_uri=${t.jwks_uri}: ${Yf(s)}`,{cause:s})}if(!n.ok)throw new ze("jwks_fetch_failed",`jwks_uri returned HTTP ${n.status} for ${t.jwks_uri}`);let i;try{i=await n.json()}catch(s){throw new ze("invalid_jwks",`jwks_uri body was not valid JSON: ${Yf(s)}`,{cause:s})}if(!i||typeof i!="object"||!Array.isArray(i.keys))throw new ze("invalid_jwks","jwks_uri body must be a JSON object with a `keys` array");return i.keys}throw new ze("no_encryption_key","client_metadata declares neither inline `jwks` nor `jwks_uri` \u2014 verifier cannot receive encrypted responses")},"resolveVerifierJwks"),Z6=o((t,e)=>{if(t.length===0)throw new ze("no_encryption_key","Verifier JWKS contained no keys");let r=t.filter(s=>s.use!=="sig");if(r.length===0)throw new ze("no_encryption_key",'Verifier JWKS contains only `use:"sig"` keys; no encryption-capable key advertised');let n=r.find(s=>s.alg===e);if(n)return n;let i=r.find(s=>!s.alg);return i||r[0]},"pickEncryptionKey"),Q6=o(async(t,e,r)=>{try{return await r.sign({alg:e,kid:r.kid,typ:"JWT"},t)}catch(n){throw new ze("sign_failed",`Wallet signer failed during JARM inner-JWS signing: ${Yf(n)}`,{cause:n})}},"signResponse"),Yf=o(t=>t instanceof Error?t.message:String(t),"describe");var h1=class h1 extends Error{constructor(e,r,n={}){super(r),this.name="VpSubmitError",this.code=e,this.status=n.status,this.body=n.body,n.cause!==void 0&&(this.cause=n.cause)}};o(h1,"VpSubmitError");var Wt=h1,Ia=o(async t=>{let{responseUri:e,vpToken:r,submission:n,state:i}=t;if(typeof e!="string"||e.length===0)throw new Wt("invalid_input","`responseUri` must be a non-empty string");if(r==null)throw new Wt("invalid_input","`vpToken` is required");if(n!==void 0&&(n===null||typeof n!="object"))throw new Wt("invalid_input","`submission` must be a PresentationSubmission object when provided (omit it entirely for DCQL flows)");let s=t.fetchImpl??globalThis.fetch;if(typeof s!="function")throw new Wt("no_fetch","No fetch implementation available; pass `fetchImpl` or configure the plugin with one");let a=t.responseMode==="direct_post.jwt"?await tP({vpToken:r,submission:n,state:i,idToken:t.idToken,clientMetadata:t.clientMetadata,nonce:t.nonce,signer:t.signer,fetchImpl:s}):Y6({vpToken:r,submission:n,state:i,idToken:t.idToken}),c;try{c=await s(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json, text/plain;q=0.9, */*;q=0.8"},body:a})}catch(p){throw new Wt("network_error",`Failed to POST to ${e}: ${p instanceof Error?p.message:String(p)}`,{cause:p})}let d=await rP(c);if(!c.ok)throw new Wt("server_error",`Verifier returned ${c.status} ${c.statusText||""}`.trim(),{status:c.status,body:d});return{status:c.status,redirectUri:nP(d),body:d}},"submitPresentation"),Y6=o(t=>{let e=new URLSearchParams;return e.set("vp_token",eP(t.vpToken)),t.submission&&e.set("presentation_submission",JSON.stringify(t.submission)),typeof t.idToken=="string"&&t.idToken.length>0&&e.set("id_token",t.idToken),typeof t.state=="string"&&t.state.length>0&&e.set("state",t.state),e.toString()},"encodeFormBody"),eP=o(t=>typeof t=="string"?t:JSON.stringify(t),"stringifyVpToken"),tP=o(async t=>{if(!t.clientMetadata)throw new Wt("invalid_input","response_mode=direct_post.jwt requires `clientMetadata` (verifier's JWKS + JWE algs)");if(typeof t.nonce!="string"||t.nonce.length===0)throw new Wt("invalid_input","response_mode=direct_post.jwt requires the verifier `nonce` for the JWE `apv` ECDH-ES KDF input");let e={vp_token:t.vpToken};t.submission&&(e.presentation_submission=t.submission),typeof t.state=="string"&&t.state.length>0&&(e.state=t.state),typeof t.idToken=="string"&&t.idToken.length>0&&(e.id_token=t.idToken);let r;try{r=await Dp({payload:e,clientMetadata:t.clientMetadata,verifierNonce:t.nonce,signer:t.signer,fetchImpl:t.fetchImpl})}catch(i){throw i instanceof ze?new Wt("jarm_encrypt_failed",`Failed to build JARM response (${i.code}): ${i.message}`,{cause:i}):i}let n=new URLSearchParams;return n.set("response",r),n.toString()},"encodeJarmBody"),rP=o(async t=>{let e=await t.text().catch(()=>"");if(!e)return;if((t.headers.get("content-type")??"").includes("application/json"))try{return JSON.parse(e)}catch{return e}try{return JSON.parse(e)}catch{return e}},"parseResponseBody"),nP=o(t=>{if(t&&typeof t=="object"){let e=t.redirect_uri;if(typeof e=="string"&&e.length>0)return e}},"extractRedirectUri");var m1=class m1 extends Error{constructor(e,r,n){super(r),this.name="SiopSignError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}};o(m1,"SiopSignError");var An=m1,ed=o(async(t,e)=>{iP(t,e);let{holder:r,audience:n,nonce:i}=t,s=t.iat??Math.floor(Date.now()/1e3),u=s+(t.lifetimeSeconds??300),a=t.issuerMode??"did",c={alg:e.signer.alg,kid:e.signer.kid,typ:"JWT"},d={iss:a==="did"?r:"https://self-issued.me/v2",sub:r,aud:n,nonce:i,iat:s,exp:u};t.vpTokenHash&&(d._vp_token={vp_token_hash:t.vpTokenHash});let p;try{p=await e.signer.sign(c,d)}catch(y){throw new An("id_token_sign_failed",`Failed to sign SIOPv2 id_token: ${y instanceof Error?y.message:String(y)}`,{cause:y})}return{idToken:p}},"signIdToken"),iP=o((t,e)=>{if(!e.signer)throw new An("missing_signer","signIdToken requires helpers.signer");if(typeof t.holder!="string"||t.holder.length===0)throw new An("invalid_input","signIdToken requires a non-empty `holder`");if(typeof t.audience!="string"||t.audience.length===0)throw new An("invalid_input","signIdToken requires a non-empty `audience`");if(typeof t.nonce!="string"||t.nonce.length===0)throw new An("invalid_input","signIdToken requires a non-empty `nonce`")},"validateInput"),y1=o(t=>t?new Set(t.split(/\s+/).filter(Boolean)):new Set,"responseTypeSet"),qp=o(t=>y1(t).has("id_token"),"requiresIdToken");var g1=o(t=>{let e=t.format??uP(t.credential);if(e==="jwt_vc_json")return oP(t.credential);if(e==="ldp_vc")return sP(t.credential)},"adaptCredentialForDcql"),Mp=o(t=>{let e=[];for(let r of t){let n=g1(r);n&&e.push({original:r,adapted:n})}return e},"adaptCredentialsForDcql"),oP=o(t=>{let e;if(typeof t=="string")e=S4(t);else if(t&&typeof t=="object"){let s=t.proof;if(s&&typeof s=="object"){let u=s.jwt;typeof u=="string"&&(e=S4(u))}}if(!e)return;let r=e.vc;if(!r||typeof r!="object"||Array.isArray(r))return;let n=r,i=k4(n.type);if(i.length!==0)return{credential_format:"jwt_vc_json",type:i,claims:n,cryptographic_holder_binding:!0}},"adaptJwtVc"),sP=o(t=>{if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,r=k4(e.type);if(r.length!==0)return{credential_format:"ldp_vc",type:r,claims:e,cryptographic_holder_binding:!0}},"adaptLdpVc"),k4=o(t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):typeof t=="string"?[t]:[],"extractTypes"),uP=o(t=>{if(typeof t=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t)?"jwt_vc_json":void 0;if(t&&typeof t=="object"&&!Array.isArray(t)){let e=t.proof;if(e&&typeof e=="object")return e.type==="JwtProof2020"?"jwt_vc_json":"ldp_vc"}},"inferDcqlFormat"),S4=o(t=>{let e=t.split(".");if(e.length===3)try{let r=JSON.parse(aP(e[1]));return r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}catch{return}},"decodeJwtPayload"),aP=o(t=>{let r=(t+"=".repeat((4-t.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/");return typeof atob=="function"?atob(r):Buffer.from(r,"base64").toString("binary")},"base64UrlDecode");var Up=o((t,e)=>{let r=Mp(t),n=r.map(u=>u.adapted),i=mo.query(e,n),s={};for(let[u,a]of Object.entries(i.credential_matches)){if(a.success){let c=a.valid_credentials.map(d=>r[d.input_credential_index]?.original).filter(d=>d!==void 0);s[u]={credentialQueryId:u,candidates:c};continue}s[u]={credentialQueryId:u,candidates:[],reason:`No held credential satisfies query "${u}"`}}return{canSatisfy:i.can_be_satisfied,matches:s,reason:i.can_be_satisfied?void 0:"No combination of held credentials satisfies the verifier's DCQL query",raw:i}},"selectCredentialsForDcql");var v1=class v1 extends Error{constructor(e,r){super(r),this.name="BuildDcqlPresentationError",this.code=e}};o(v1,"BuildDcqlPresentationError");var Sn=v1,$p=o(t=>{let{query:e,chosen:r,holder:n}=t;if(r.length===0)throw new Sn("no_selections","buildDcqlPresentations requires at least one chosen credential");let i=t.makeId??lP,s=new Map;for(let c of r){let d=s.get(c.credentialQueryId);d?d.push(c.candidate):s.set(c.credentialQueryId,[c.candidate])}let u=new Map;for(let c of e.credentials)u.set(c.id,c);let a=[];for(let c of e.credentials){let d=s.get(c.id);d&&(a.push(cP(c,d,n,i)),s.delete(c.id))}if(s.size>0){let c=Array.from(s.keys()).join(", ");throw new Sn("unknown_credential_query",`chosen credentials reference query ids the DCQL query doesn't declare: ${c}`)}return a},"buildDcqlPresentations"),cP=o((t,e,r,n)=>{let i=fP(t.format,t.id),s=e.map((a,c)=>dP(a,t.id,c)),u={"@context":["https://www.w3.org/2018/credentials/v1"],id:`urn:uuid:${pP(n)}`,type:["VerifiablePresentation"],holder:r,verifiableCredential:s};return{credentialQueryId:t.id,unsignedVp:u,vpFormat:i,candidates:e}},"buildOnePresentation"),fP=o((t,e)=>{if(t==="jwt_vc_json")return"jwt_vp_json";if(t==="ldp_vc")return"ldp_vp";throw new Sn("unsupported_format",`DCQL query "${e}" requests format "${t}", which the plugin doesn't yet build presentations for (sd-jwt-vc and mso_mdoc are tracked for follow-up slices)`)},"vpFormatForQueryFormat"),dP=o((t,e,r)=>{let n=t.credential;if(typeof n=="string"){if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(n))return n;throw new Sn("invalid_jwt_vc",`chosen candidate at index ${r} 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 s=i.jwt;if(typeof s=="string")return s}return n}throw new Sn("invalid_jwt_vc",`chosen candidate at index ${r} for query "${e}" is neither a JWT string nor a JSON object`)},"normalizeForEmbedding"),lP=o(()=>{let t=typeof globalThis<"u"&&"crypto"in globalThis?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function"){let e=new Uint8Array(8);return t.getRandomValues(e),Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,18)},"defaultMakeId"),pP=o(t=>{let r=(t().replace(/[^0-9a-f]/gi,"")+"0".repeat(32)).slice(0,32);return[r.slice(0,8),r.slice(8,12),"4"+r.slice(13,16),(parseInt(r.slice(16,17),16)&3|8).toString(16)+r.slice(17,20),r.slice(20,32)].join("-")},"makeUuidV4");var b1=o(async(t,e)=>{let r=[];for(let n of t.built){let i=await di({unsignedVp:n.unsignedVp,vpFormat:n.vpFormat,audience:t.audience,nonce:t.nonce,holder:t.holder,iat:t.iat},e);r.push({credentialQueryId:n.credentialQueryId,vpToken:i.vpToken,vpFormat:n.vpFormat})}return r},"signDcqlPresentations"),Vp=o(async(t,e)=>{let r=await b1(t,e);return{vpToken:w1(r),presentations:r}},"buildDcqlResponse"),w1=o(t=>{let e={};for(let r of t)e[r.credentialQueryId]=r.vpToken;return e},"assembleDcqlVpToken");var E4=o((t,e={})=>{let r=e.fetch??globalThis.fetch,n={didResolver:e.didResolver,trustedX509Roots:e.trustedX509Roots,unsafeAllowSelfSigned:e.unsafeAllowSelfSignedRequestObject,unsafeSkipRequestObjectSignatureVerification:e.unsafeSkipRequestObjectSignatureVerification},i=o(async s=>{let u=id(s);if(u.kind==="by_value")return u.offer;if(typeof r!="function")throw new ge("invalid_uri","No fetch implementation available; pass `config.fetch` to getOpenID4VCPlugin()");let a=await Kp(u.uri,r);if(a.kind!=="by_value")throw new ge("invalid_uri","Unexpected by_reference result after resolving credential_offer_uri");return a.offer},"resolveOffer");return{name:"OpenID4VC",displayName:"OpenID4VC",description:"OpenID for Verifiable Credentials holder support \u2014 Credential Offers, VCI, VP, and SIOPv2.",methods:{parseCredentialOffer:o((s,u)=>id(u),"parseCredentialOffer"),resolveCredentialOffer:o(async(s,u)=>i(u),"resolveCredentialOffer"),acceptCredentialOffer:o(async(s,u,a={})=>{let c=typeof u=="string"?await i(u):u,d=await S1(s,a);return _d({offer:c,signer:d,options:a,fetchImpl:r})},"acceptCredentialOffer"),acceptAndStoreCredentialOffer:o(async(s,u,a={})=>{let c=await(async()=>{let p=typeof u=="string"?await i(u):u,y=await S1(s,a);return _d({offer:p,signer:y,options:a,fetchImpl:r})})(),d=await Hh(s,c,mP(a));return{...c,...d}},"acceptAndStoreCredentialOffer"),beginCredentialOfferAuthCode:o(async(s,u,a)=>{let c=typeof u=="string"?await i(u):u;return Uh({offer:c,redirectUri:a.redirectUri,clientId:a.clientId,configurationIds:a.configurationIds,scope:a.scope,fetchImpl:r})},"beginCredentialOfferAuthCode"),completeCredentialOfferAuthCode:o(async(s,u)=>{let a=u.signer??await S1(s,{});return $h({flowHandle:u.flowHandle,code:u.code,state:u.state,signer:a,fetchImpl:r})},"completeCredentialOfferAuthCode"),parseAuthorizationRequest:o((s,u)=>Lf(u),"parseAuthorizationRequest"),resolveAuthorizationRequest:o(async(s,u)=>Wf(u,r,n),"resolveAuthorizationRequest"),prepareVerifiablePresentation:o(async(s,u,a)=>{let c=await Oa(u,r,n);if(c.dcql_query){let d=Up(a,c.dcql_query);return{request:c,dcqlSelection:d}}if(c.presentation_definition){let d=Bp(a,c.presentation_definition);return{request:c,selection:d}}return{request:c,selection:{descriptors:[],canSatisfy:!0,reason:void 0}}},"prepareVerifiablePresentation"),buildPresentation:o(async(s,u,a,c={})=>{let d=await Oa(u,r,n),p=C4(d),y=c.holder??s.id.did(),v=Qf({pd:p,chosen:a,holder:y,envelopeFormat:c.envelopeFormat});return{request:d,prepared:v}},"buildPresentation"),signPresentation:o(async(s,u,a,c={})=>{let d=await Oa(u,r,n),p=c.holder??(typeof a.unsignedVp.holder=="string"?a.unsignedVp.holder:s.id.did());if(a.vpFormat==="jwt_vp_json"){let y=c.signer??await Hp(s);return di({unsignedVp:a.unsignedVp,vpFormat:a.vpFormat,audience:d.client_id,nonce:d.nonce,holder:p},{jwtSigner:y})}return di({unsignedVp:a.unsignedVp,vpFormat:a.vpFormat,audience:d.client_id,nonce:d.nonce,holder:p},{ldpVpSigner:A1(s)})},"signPresentation"),submitPresentation:o(async(s,u,a,c,d={})=>{let p=await Oa(u,r,n),y=p.response_uri??p.redirect_uri;if(!y)throw new Error("Authorization Request has no response_uri / redirect_uri \u2014 cannot submitPresentation");return Ia({responseUri:y,vpToken:a.vpToken,submission:c,idToken:d.idToken,state:p.state,fetchImpl:r,..._1(p,await x1(s,p))})},"submitPresentation"),signIdToken:o(async(s,u,a={})=>{let c=await Oa(u,r,n),d=a.holder??s.id.did(),p=a.signer??await Hp(s);return ed({holder:d,audience:c.client_id,nonce:c.nonce,lifetimeSeconds:a.lifetimeSeconds,issuerMode:a.issuerMode,vpTokenHash:a.vpTokenHash},{signer:p})},"signIdToken"),presentCredentials:o(async(s,u,a,c={})=>{let d=await Oa(u,r,n),p=c.holder??s.id.did(),y=c.signer,v=o(async()=>(y||(y=await Hp(s)),y),"ensureSharedJwtSigner"),x=o(async()=>{if(qp(d.response_type))return ed({holder:p,audience:d.client_id,nonce:d.nonce},{signer:await v()})},"signIdTokenIfRequested"),A=d.response_uri??d.redirect_uri;if(!A)throw new Error("Authorization Request has no response_uri / redirect_uri \u2014 cannot presentCredentials");if(d.dcql_query){let ye=yP(a),ae=$p({query:d.dcql_query,chosen:ye,holder:p}),Ne=ae.some(ct=>ct.vpFormat==="jwt_vp_json"),xt=ae.some(ct=>ct.vpFormat==="ldp_vp"),at={...Ne?{jwtSigner:await v()}:{},...xt?{ldpVpSigner:A1(s)}:{}},Bt=await Vp({built:ae,audience:d.client_id,nonce:d.nonce,holder:p},at),_r=await x(),Fr=await Ia({responseUri:A,vpToken:Bt.vpToken,idToken:_r?.idToken,state:d.state,fetchImpl:r,..._1(d,await x1(s,d))});return{request:d,dcqlBuilt:ae,dcqlSigned:Bt.presentations,dcqlVpToken:Bt.vpToken,signedIdToken:_r,submitted:Fr}}let B=C4(d),I=hP(a),J=Qf({pd:B,chosen:I,holder:p,envelopeFormat:c.envelopeFormat}),de=J.vpFormat==="jwt_vp_json"?{jwtSigner:await v()}:{ldpVpSigner:A1(s)},fe=await di({unsignedVp:J.unsignedVp,vpFormat:J.vpFormat,audience:d.client_id,nonce:d.nonce,holder:p},de),ve=await x(),Y=await Ia({responseUri:A,vpToken:fe.vpToken,submission:J.submission,idToken:ve?.idToken,state:d.state,fetchImpl:r,..._1(d,await x1(s,d))});return{request:d,prepared:J,signed:fe,signedIdToken:ve,submitted:Y}},"presentCredentials")}}},"getOpenID4VCPlugin"),Oa=o(async(t,e,r)=>typeof t=="string"?await Wf(t,e,r):t,"resolveRequestInput"),C4=o(t=>{if(!t.presentation_definition)throw new Error("Authorization Request has no presentation_definition \u2014 cannot build a VP");return t.presentation_definition},"requirePresentationDefinition"),hP=o(t=>{for(let[e,r]of t.entries())if(!("descriptorId"in r)||typeof r.descriptorId!="string")throw new Error(`chosen[${e}] is missing 'descriptorId' \u2014 PEX requests need ChosenCredential entries (received DCQL-shape entry with credentialQueryId="${r.credentialQueryId}")`);return t},"assertPexChosen"),yP=o(t=>{for(let[e,r]of t.entries())if(!("credentialQueryId"in r)||typeof r.credentialQueryId!="string")throw new Error(`chosen[${e}] is missing 'credentialQueryId' \u2014 DCQL requests need DcqlChosenCredential entries (received PEX-shape entry with descriptorId="${r.descriptorId}")`);return t},"assertDcqlChosen"),_1=o((t,e)=>t.response_mode!=="direct_post.jwt"?{}:{responseMode:"direct_post.jwt",clientMetadata:t.client_metadata,nonce:t.nonce,signer:e},"buildJarmOptions"),x1=o(async(t,e)=>{if(e.response_mode!=="direct_post.jwt")return;let r=e.client_metadata?.authorization_signed_response_alg;if(!(typeof r!="string"||r.length===0))return Hp(t)},"maybeJarmSigner"),Hp=o(async t=>{let e=P4(t,"VP signing"),r=t.id.did(),n=await t.invoke.didToVerificationMethod(r);return wd({keypair:e,kid:n})},"ensureVpJwtSigner"),A1=o(t=>({sign:o(async(e,{domain:r,challenge:n})=>t.invoke.issuePresentation(e,{domain:r,challenge:n}),"sign")}),"buildLdpVpSigner"),S1=o(async(t,e)=>{if(e.signer)return e.signer;let r=P4(t,"VCI proof-of-possession"),n=t.id.did(),i=await t.invoke.didToVerificationMethod(n);return wd({keypair:r,kid:i})},"ensureSigner"),P4=o((t,e)=>{let r;try{r=t.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(!r||r.kty!=="OKP"||r.crv!=="Ed25519")throw new Error(`OpenID4VC ${e} requires an Ed25519 keypair, but the host LearnCard returned ${r?`kty=${r.kty} crv=${r.crv??"<none>"}`:"no keypair"}. Pass \`options.signer\` to bring your own signer (HSM / secp256k1 / external backend).`);return r},"requireEd25519Keypair"),mP=o(t=>({storage:t.storage,encrypt:t.encrypt,category:t.category,title:t.title,imgUrl:t.imgUrl,upload:t.upload,addToIndex:t.addToIndex,makeId:t.makeId}),"splitStoreOptions");var k1=o(t=>ai(t),"buildDcqlQuery"),T4=o(t=>{let e=t.format??"jwt_vc_json";if(t.types.length===0)throw new Error("requestW3cVc: `types` must contain at least one type string");let r={id:t.id,format:e,meta:{type_values:[Array.from(t.types)]}};return t.claims&&t.claims.length>0&&(r.claims=t.claims.map(n=>{let i={path:Array.from(n.path)};return n.values&&n.values.length>0&&(i.values=Array.from(n.values)),n.id&&(i.id=n.id),i})),t.requireHolderBinding===!1&&(r.require_cryptographic_holder_binding=!1),k1({credentials:[r]})},"requestW3cVc");
|
|
29
|
+
`},"derToPem"),cE=o(async t=>{let{jws:e,header:r,opts:n}=t;if(!!!n.unsafeAllowSelfSigned)throw new Q("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 s=r.x5c;if(!Array.isArray(s)||s.length===0)throw new Q("invalid_request_object","client-id prefix=pre-registered requires an x5c header to verify the signature against (no key material available otherwise)");let u=n1(s[0]),a;try{a=await Od(u,Et(r.alg)??"RS256")}catch(c){throw new Q("request_signer_untrusted",`Failed to import leaf X.509 cert: ${Zt(c)}`,{cause:c})}try{await ac(e,a)}catch(c){throw new Q("request_signature_invalid",`JWS signature verification failed: ${Zt(c)}`,{cause:c})}},"verifyWithPreRegistered"),fE=o(t=>{try{return new URL(t.includes("://")?t:`https://${t}`).hostname}catch{return t}},"hostFromClientId"),i1=o((t=globalThis.fetch)=>async e=>{if(e.startsWith("did:jwk:"))return dE(e);if(e.startsWith("did:web:"))return lE(e,t);throw new Q("did_resolution_failed",`Built-in resolver does not support ${e.split(":").slice(0,2).join(":")} \u2014 pass a custom didResolver`)},"builtInDidResolver"),dE=o(t=>{let e=t.replace(/^did:jwk:/,"").split("#")[0],r;try{let i="=".repeat((4-e.length%4)%4),s=e.replace(/-/g,"+").replace(/_/g,"/")+i;r=JSON.parse(Buffer.from(s,"base64").toString("utf8"))}catch(i){throw new Q("did_resolution_failed",`Failed to decode did:jwk identifier: ${Zt(i)}`,{cause:i})}let n=`${t}#0`;return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:r}],authentication:[n],assertionMethod:[n]}},"resolveDidJwk"),lE=o(async(t,e)=>{if(typeof e!="function")throw new Q("did_resolution_failed","did:web resolution requires a fetch implementation");let n=t.replace(/^did:web:/,"").split(":").map(d=>decodeURIComponent(d)),i=n.shift(),s=n.length===0?"/.well-known/did.json":`/${n.join("/")}/did.json`,u=`https://${i}${s}`,a;try{a=await e(u,{method:"GET"})}catch(d){throw new Q("did_resolution_failed",`Failed to fetch ${u}: ${Zt(d)}`,{cause:d})}if(!a.ok)throw new Q("did_resolution_failed",`${u} returned ${a.status} ${a.statusText}`);let c;try{c=await a.json()}catch(d){throw new Q("did_resolution_failed",`${u} response was not JSON: ${Zt(d)}`,{cause:d})}if(!c||typeof c!="object"||Array.isArray(c))throw new Q("did_resolution_failed",`${u} response was not a DID Document object`);return c},"resolveDidWeb"),kA=o((t,e,r)=>{let n=CA(r.presentation_definition)?r.presentation_definition:void 0,i=Et(r.presentation_definition_uri),s;if(r.dcql_query!==void 0&&r.dcql_query!==null){if(n||i)throw new re("both_pex_and_dcql","Request Object claims carry both PEX (presentation_definition[_uri]) and DCQL (dcql_query); OID4VP 1.0 \xA75.3 forbids this");s=Ni(r.dcql_query)}let u=CA(r.client_metadata)?r.client_metadata:void 0;return{client_id:t,client_id_scheme:e,response_type:Et(r.response_type)??"vp_token",response_mode:Et(r.response_mode),response_uri:Et(r.response_uri),redirect_uri:Et(r.redirect_uri),nonce:Et(r.nonce)??"",state:Et(r.state),presentation_definition:n,presentation_definition_uri:i,dcql_query:s,client_metadata:u,client_metadata_uri:Et(r.client_metadata_uri),scope:Et(r.scope)}},"buildRequestFromClaims"),Et=o(t=>typeof t=="string"&&t.length>0?t:void 0,"asString"),CA=o(t=>t!==null&&typeof t=="object"&&!Array.isArray(t),"isObject"),EA=o(t=>/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t),"looksLikeJws"),PA=o(t=>{let e="=".repeat((4-t.length%4)%4),r=t.replace(/-/g,"+").replace(/_/g,"/")+e;return Buffer.from(r,"base64").toString("utf8")},"b64urlDecode"),Zt=o(t=>t instanceof Error?t.message:String(t),"describe");var ud=o(t=>{if(typeof t!="string"||t.trim().length===0)throw new re("invalid_uri","Authorization Request URI must be a non-empty string");let e=pE(t),r=e.get("request_uri");if(typeof r=="string"&&r.length>0){if(!OA(r))throw new re("invalid_uri","request_uri must be an absolute https:// URL");return{kind:"by_reference_request_uri",requestUri:r,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:hE(e)}},"parseAuthorizationRequestUri"),s1=o(async(t,e=globalThis.fetch)=>{if(typeof e!="function")throw new re("presentation_definition_fetch_failed","No fetch implementation available to resolve presentation_definition_uri");if(!OA(t))throw new re("invalid_uri","presentation_definition_uri must be an absolute https:// URL");let r;try{r=await e(t,{method:"GET"})}catch(i){throw new re("presentation_definition_fetch_failed",`Failed to fetch presentation_definition_uri: ${yE(i)}`,{cause:i})}if(!r.ok)throw new re("presentation_definition_fetch_failed",`presentation_definition_uri returned ${r.status} ${r.statusText}`);let n;try{n=await r.json()}catch(i){throw new re("invalid_json","presentation_definition_uri response was not valid JSON",{cause:i})}return IA(n)},"resolvePresentationDefinitionByReference"),ad=o(async(t,e=globalThis.fetch,r={})=>{let n=ud(t),i;if(n.kind==="by_value")i=n.request;else{let s=n.rawParams.get("client_id")??void 0,u=n.rawParams.get("client_id_scheme")??void 0;i=await jp({requestUri:n.kind==="by_reference_request_uri"?n.requestUri:void 0,inlineJwt:n.kind==="by_reference_request_jwt"?n.jwt:void 0,urlClientId:s,urlClientIdScheme:u,fetchImpl:e,didResolver:r.didResolver,trustedX509Roots:r.trustedX509Roots,unsafeAllowSelfSigned:r.unsafeAllowSelfSigned,unsafeSkipRequestObjectSignatureVerification:r.unsafeSkipRequestObjectSignatureVerification})}if(i.presentation_definition)return i;if(i.presentation_definition_uri){let s=await s1(i.presentation_definition_uri,e);return{...i,presentation_definition:s}}return i},"resolveAuthorizationRequest"),pE=o(t=>{let e=t.indexOf("?");if(e!==-1)return new URLSearchParams(t.slice(e+1));if(t.includes("://")||/^[a-z][a-z0-9+.-]*:/i.test(t))throw new re("invalid_uri","Authorization Request URI has no query string");if(t.includes("="))return new URLSearchParams(t);throw new re("invalid_uri","Authorization Request URI has no query string")},"extractSearchParams"),hE=o(t=>{let e=t.get("client_id");if(!e)throw new re("missing_client_id","Authorization Request is missing client_id");let r=t.get("nonce");if(!r)throw new re("missing_nonce","Authorization Request is missing nonce");let n=t.get("response_type");if(!n)throw new re("missing_response_type","Authorization Request is missing response_type");let i=n.split(/\s+/).filter(Boolean),s=new Set(["vp_token","id_token"]);if(!i.some(ee=>s.has(ee)))throw new re("unsupported_response_type",`Authorization Request response_type "${n}" is not supported (expected vp_token and/or id_token)`);let u=t.get("response_uri")??void 0,a=t.get("redirect_uri")??void 0,c=t.get("response_mode")??void 0;if(!u&&!a)throw new re("missing_response_target","Authorization Request is missing both response_uri and redirect_uri");let d=t.get("presentation_definition"),h=t.get("presentation_definition_uri"),y=t.get("dcql_query");if(d&&h)throw new re("both_definition_and_uri","Authorization Request has both presentation_definition and presentation_definition_uri");if(y&&(d||h))throw new re("both_pex_and_dcql","Authorization Request carries both PEX (presentation_definition[_uri]) and DCQL (dcql_query); OID4VP 1.0 \xA75.3 forbids this");let b;if(d){let ee;try{ee=JSON.parse(d)}catch(ve){throw new re("invalid_json","presentation_definition query parameter was not valid JSON",{cause:ve})}b=IA(ee)}let A;if(y){let ee;try{ee=JSON.parse(y)}catch(ve){throw new re("invalid_json","dcql_query query parameter was not valid JSON",{cause:ve})}A=Ni(ee)}let S=t.get("scope")??void 0;if(i.includes("vp_token")&&!b&&!h&&!A&&!S)throw new re("missing_presentation_definition","Authorization Request has none of presentation_definition, presentation_definition_uri, dcql_query, or scope");let I=t.get("client_metadata"),J;if(I)try{let ee=JSON.parse(I);if(ee&&typeof ee=="object"&&!Array.isArray(ee))J=ee;else throw new re("invalid_json","client_metadata query parameter must be a JSON object")}catch(ee){throw ee instanceof re?ee:new re("invalid_json","client_metadata query parameter was not valid JSON",{cause:ee})}let pe=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"]),de={};t.forEach((ee,ve)=>{pe.has(ve)||(de[ve]=ee)});let{prefix:xe}=_p(e,t.get("client_id_scheme")??void 0);return{client_id:e,client_id_scheme:xe,response_type:n,response_mode:c,response_uri:u,redirect_uri:a,nonce:r,state:t.get("state")??void 0,presentation_definition:b,presentation_definition_uri:h??void 0,dcql_query:A,client_metadata:J,client_metadata_uri:t.get("client_metadata_uri")??void 0,scope:S,...Object.keys(de).length>0?{extra:de}:{}}},"buildRequestFromParams"),IA=o(t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new re("invalid_presentation_definition","presentation_definition must be a JSON object");let e=t;if(typeof e.id!="string"||e.id.length===0)throw new re("invalid_presentation_definition","presentation_definition is missing a string `id`");if(!Array.isArray(e.input_descriptors)||e.input_descriptors.length===0)throw new re("invalid_presentation_definition","presentation_definition must declare a non-empty input_descriptors array");for(let[r,n]of e.input_descriptors.entries()){if(!n||typeof n!="object")throw new re("invalid_presentation_definition",`input_descriptors[${r}] must be an object`);let i=n;if(typeof i.id!="string"||i.id.length===0)throw new re("invalid_presentation_definition",`input_descriptors[${r}].id must be a non-empty string`);if(!i.constraints||typeof i.constraints!="object")throw new re("invalid_presentation_definition",`input_descriptors[${r}].constraints must be an object`)}return e},"validatePresentationDefinition"),OA=o(t=>{try{return new URL(t).protocol==="https:"}catch{return!1}},"isHttpsUrl"),yE=o(t=>t instanceof Error?t.message:String(t),"describe");var n4=Ui(YS());var tT=512,U1=o((t,e)=>{if(!Array.isArray(e.path)||e.path.length===0)return{matched:!1,reason:"Field has no `path[]` declared"};for(let r of e.path){let n;try{n=$1(t,r)}catch(i){return{matched:!1,reason:`JSONPath "${r}" could not be evaluated: ${uT(i)}`}}if(n.length!==0)for(let i of n){if(!e.filter)return{matched:!0,matchedPath:r,value:i};if(Wa(i,e.filter))return{matched:!0,matchedPath:r,value:i};if(Array.isArray(i)&&iT(e.filter)){for(let s of i)if(Wa(s,e.filter))return{matched:!0,matchedPath:r,value:s}}}}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"),th=o((t,e)=>{let n=e.constraints?.fields??[],i=[];for(let s of n){let u=U1(t,s);if(i.push(u),!u.matched)return{matched:!1,descriptorId:e.id,fields:i,reason:u.reason}}return{matched:!0,descriptorId:e.id,fields:i}},"matchInputDescriptor"),$1=o((t,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 r=nT(e),n=[t];for(let i of r){let s=[];for(let u of n)switch(i.kind){case"property":{let a=rT(u,i.name);a!==void 0&&s.push(a);break}case"index":{Array.isArray(u)&&i.index<u.length&&s.push(u[i.index]);break}case"wildcard":{if(Array.isArray(u))for(let a of u)s.push(a);else if(u&&typeof u=="object")for(let a of Object.values(u))s.push(a);break}case"descendant":{M1(u,i.name,s);break}}n=s}return n},"queryJsonPath"),rT=o((t,e)=>{if(t!=null&&!Array.isArray(t)&&typeof t=="object")return t[e]},"getProperty"),M1=o((t,e,r)=>{if(t!=null){if(Array.isArray(t)){for(let n of t)M1(n,e,r);return}if(typeof t=="object"){let n=t;for(let[i,s]of Object.entries(n))i===e&&r.push(s),M1(s,e,r)}}},"collectDescendants"),nT=o(t=>{let e=[],r=t.startsWith("$")?1:0;for(;r<t.length;){let n=t[r];if(n===".")if(t[r+1]==="."){r+=2;let i=e4(t,r);if(!i.text)throw new Error(`Recursive descent ".." at position ${r} must be followed by a property name`);e.push({kind:"descendant",name:i.text}),r=i.next}else{if(r+=1,t[r]==="*"){e.push({kind:"wildcard"}),r+=1;continue}let i=e4(t,r);if(!i.text)throw new Error(`Property accessor "." at position ${r} must be followed by an identifier`);e.push({kind:"property",name:i.text}),r=i.next}else if(n==="["){let i=t.indexOf("]",r+1);if(i===-1)throw new Error(`Unterminated "[" in JSONPath "${t}"`);let s=t.slice(r+1,i).trim();if(s==="*")e.push({kind:"wildcard"});else if(/^-?\d+$/.test(s))e.push({kind:"index",index:parseInt(s,10)});else if(/^'[^']*'$/.test(s)||/^"[^"]*"$/.test(s))e.push({kind:"property",name:s.slice(1,-1)});else throw new Error(`Unsupported bracket expression [${s}] in JSONPath "${t}"`);r=i+1}else throw new Error(`Unexpected character "${n}" at position ${r} in JSONPath "${t}"`)}return e},"tokenizeJsonPath"),e4=o((t,e)=>{let r=e;for(;r<t.length;){let n=t[r];if(!/[A-Za-z0-9_\-@:]/.test(n))break;r+=1}return{text:t.slice(e,r),next:r}},"readIdentifier"),Wa=o((t,e)=>{if("type"in e&&!(Array.isArray(e.type)?e.type:[e.type]).some(i=>sT(t,i))||"const"in e&&!eh(t,e.const))return!1;if("enum"in e){let r=e.enum;if(!Array.isArray(r)||!r.some(n=>eh(t,n)))return!1}if("pattern"in e){if(typeof t!="string")return!1;let r=e.pattern;if(typeof r!="string"||r.length>tT||!(0,n4.default)(r))return!1;let n;try{n=new RegExp(r)}catch{return!1}try{if(!n.test(t))return!1}catch{return!1}}if(typeof t=="number"&&(typeof e.minimum=="number"&&t<e.minimum||typeof e.maximum=="number"&&t>e.maximum||typeof e.exclusiveMinimum=="number"&&t<=e.exclusiveMinimum||typeof e.exclusiveMaximum=="number"&&t>=e.exclusiveMaximum)||typeof t=="string"&&(typeof e.minLength=="number"&&t.length<e.minLength||typeof e.maxLength=="number"&&t.length>e.maxLength))return!1;if(Array.isArray(t)){if(e.contains&&typeof e.contains=="object"){let r=e.contains;if(!t.some(i=>Wa(i,r)))return!1}if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items)){let r=e.items;if(!t.every(i=>Wa(i,r)))return!1}if(typeof e.minItems=="number"&&t.length<e.minItems||typeof e.maxItems=="number"&&t.length>e.maxItems)return!1}return!0},"satisfiesFilter"),iT=o(t=>{if(r4(t,["contains","items","minItems","maxItems"]))return!1;if("type"in t){let e=Array.isArray(t.type)?t.type:[t.type];return e.length===0?!1:e.every(r=>typeof r=="string"&&oT.has(r))}return r4(t,["pattern","minLength","maxLength","minimum","maximum","exclusiveMinimum","exclusiveMaximum"])||"const"in t&&t4(t.const)?!0:"enum"in t&&Array.isArray(t.enum)&&t.enum.length>0?t.enum.every(t4):!1},"expectsPrimitive"),oT=new Set(["string","number","integer","boolean","null"]),t4=o(t=>t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean","isPrimitiveValue"),r4=o((t,e)=>e.some(r=>r in t),"hasAnyKeyword"),sT=o((t,e)=>{switch(e){case"string":return typeof t=="string";case"number":return typeof t=="number";case"integer":return typeof t=="number"&&Number.isInteger(t);case"boolean":return typeof t=="boolean";case"null":return t===null;case"array":return Array.isArray(t);case"object":return t!==null&&typeof t=="object"&&!Array.isArray(t);default:return!1}},"matchesType"),eh=o((t,e)=>{if(t===e)return!0;if(t===null||e===null)return t===e;if(typeof t!=typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!eh(t[r],e[r]))return!1;return!0}if(typeof t=="object"){if(typeof e!="object"||Array.isArray(e))return!1;let r=t,n=e,i=Object.keys(r),s=Object.keys(n);if(i.length!==s.length)return!1;for(let u of i)if(!eh(r[u],n[u]))return!1;return!0}return!1},"deepEqual"),uT=o(t=>t instanceof Error?t.message:String(t),"describe");var rh=o((t,e)=>{let r=t.map((u,a)=>({index:a,candidate:{...u,format:u.format??yd(u.credential)}})),n=e.input_descriptors.map(u=>{let a=[],c=u.format??e.format;for(let d of r){let{candidate:h,index:y}=d;if(c&&!cT(h.format,c))continue;let b=fT(h),A=th(b,u);A.matched&&a.push({descriptorId:u.id,candidate:h,match:A,candidateIndex:y})}return{descriptorId:u.id,candidates:a,reason:a.length===0?lT(u,r.length,c):void 0}}),i=new Set(n.filter(u=>u.candidates.length>0).map(u=>u.descriptorId)),s=aT(e,i);return{descriptors:n,canSatisfy:s.satisfied,reason:s.satisfied?void 0:s.reason}},"selectCredentials"),s4=o((t,e,r={})=>{let n=r.makeId??pT;return{id:r.submissionId??n(),definition_id:t.id,descriptor_map:e.map(i=>{let s={id:i.descriptorId,format:i.format,path:i.path};return i.pathNested&&(s.path_nested={id:i.descriptorId,format:i.format,path:i.pathNested}),s})}},"buildPresentationSubmission"),yd=o(t=>{if(typeof t=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t)?"jwt_vc_json":void 0;if(!t||typeof t!="object")return;let r=t.proof;if(r&&typeof r=="object"){if(typeof r.jwt=="string"||r.type==="JwtProof2020")return"jwt_vc_json";if(typeof r.type=="string")return"ldp_vc"}},"inferCredentialFormat"),aT=o((t,e)=>{let r=t.submission_requirements;if(!r||r.length===0){let n=t.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 r){let i=u4(n,t,e);if(!i.satisfied)return i}return{satisfied:!0}},"evaluateSubmissionRequirements"),u4=o((t,e,r)=>{if(typeof t.from=="string"&&t.from.length>0){let n=e.input_descriptors.filter(s=>s.group?.includes(t.from));if(n.length===0)return{satisfied:!1,reason:`submission_requirement references unknown group "${t.from}"`};let i=n.filter(s=>r.has(s.id));return i4(t,i.length,n.length)}if(Array.isArray(t.from_nested)&&t.from_nested.length>0){let n=0;for(let i of t.from_nested)u4(i,e,r).satisfied&&(n+=1);return i4(t,n,t.from_nested.length)}return{satisfied:!1,reason:"submission_requirement has neither `from` nor `from_nested`"}},"evaluateRequirement"),i4=o((t,e,r)=>{let n=t.name??t.from??"<anonymous>";return t.rule==="all"?e>=r?{satisfied:!0}:{satisfied:!1,reason:`Requirement "${n}" (rule=all) needs ${r} matches, only ${e} available`}:t.rule==="pick"?typeof t.count=="number"&&e<t.count?{satisfied:!1,reason:`Requirement "${n}" (rule=pick) needs count=${t.count} matches, only ${e} available`}:typeof t.min=="number"&&e<t.min?{satisfied:!1,reason:`Requirement "${n}" (rule=pick) needs min=${t.min} matches, only ${e} available`}:t.count===void 0&&t.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 "${t.rule}"`}},"applyRule"),cT=o((t,e)=>t?Object.prototype.hasOwnProperty.call(e,t):!1,"formatIsPermitted"),fT=o(t=>{let{credential:e,format:r}=t;if(r==="jwt_vc_json"){if(typeof e=="string"){let n=o4(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 s=o4(i);if(s)return s}}}}return e},"decodeCandidateForMatching"),o4=o(t=>{let e=t.split(".");if(e.length===3)try{return JSON.parse(dT(e[1]))}catch{return}},"decodeJwtVc"),dT=o(t=>{let r=(t+"=".repeat((4-t.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/");return typeof atob=="function"?atob(r):Buffer.from(r,"base64").toString("binary")},"base64UrlDecode"),lT=o((t,e,r)=>{if(e===0)return"You have no credentials in your wallet yet";let n=t.name??t.id;if(r){let i=Object.keys(r).join(", ");return`No credential satisfies "${n}" (required format: ${i})`}return`No credential satisfies "${n}"`},"explainNoMatches"),pT=o(()=>{let t=typeof globalThis<"u"&&"crypto"in globalThis?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function"){let e=new Uint8Array(8);return t.getRandomValues(e),Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,18)},"defaultMakeId");var V1=class V1 extends Error{constructor(e,r){super(r),this.name="BuildPresentationError",this.code=e}};o(V1,"BuildPresentationError");var Di=V1,md=o(t=>{let{pd:e,chosen:r,holder:n}=t;if(!r||r.length===0)throw new Di("no_selections","buildPresentation requires at least one chosen credential");let i=new Set(e.input_descriptors.map(h=>h.id)),s=r.map((h,y)=>{if(!i.has(h.descriptorId))throw new Di("unknown_descriptor",`Chosen credential at index ${y} references unknown descriptor "${h.descriptorId}"`);return{descriptorId:h.descriptorId,...hT(h.candidate,y)}}),u=t.envelopeFormat??mT(e,s.map(h=>h.format)),a=t.makeId??wT,c={"@context":["https://www.w3.org/2018/credentials/v1"],id:t.presentationId??`urn:uuid:${_T(a)}`,type:["VerifiablePresentation"],holder:n,verifiableCredential:s.map(h=>h.credential)},d={id:t.submissionId??a(),definition_id:e.id,descriptor_map:s.map((h,y)=>({id:h.descriptorId,format:h.format,path:bT(y,u)}))};return{unsignedVp:c,submission:d,vpFormat:u,innerFormats:s.map(h=>h.format)}},"buildPresentation"),hT=o((t,e)=>{let r=t.format??yd(t.credential);if(!r)throw new Di("unknown_credential_format",`Chosen credential at index ${e} has no detectable format (provide candidate.format or a shape inferCredentialFormat recognizes)`);if(r==="jwt_vc_json"){let n=yT(t.credential);if(!n)throw new Di("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:r}}return{credential:t.credential,format:r}},"normalizeForEmbedding"),yT=o(t=>{if(typeof t=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t)?t:void 0;if(t&&typeof t=="object"){let e=t.proof;if(e&&typeof e=="object"){let r=e.jwt;if(typeof r=="string")return r}}},"extractCompactJws"),mT=o((t,e)=>{let r=gT(t.format),n=vT(e);return r.has("jwt_vp_json")&&!r.has("ldp_vp")?"jwt_vp_json":r.has("ldp_vp")&&!r.has("jwt_vp_json")?"ldp_vp":(r.has("jwt_vp_json")&&r.has("ldp_vp"),n)},"inferEnvelopeFormat"),gT=o(t=>{let e=new Set;return t&&("jwt_vp_json"in t&&e.add("jwt_vp_json"),"ldp_vp"in t&&e.add("ldp_vp")),e},"vpFormatsFromDesignation"),vT=o(t=>t.length===0?"ldp_vp":t.every(r=>r==="jwt_vc_json")?"jwt_vp_json":"ldp_vp","homogeneousVpFormatFromInner"),bT=o((t,e)=>e==="jwt_vp_json"?`$.vp.verifiableCredential[${t}]`:`$.verifiableCredential[${t}]`,"pathForIndex"),wT=o(()=>{let t=typeof globalThis<"u"&&"crypto"in globalThis?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function"){let e=new Uint8Array(8);return t.getRandomValues(e),Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,18)},"defaultMakeId"),_T=o(t=>{let r=(t().replace(/[^0-9a-f]/gi,"")+"0".repeat(32)).slice(0,32);return[r.slice(0,8),r.slice(8,12),"4"+r.slice(13,16),(parseInt(r.charAt(16),16)&3|8).toString(16)+r.slice(17,20),r.slice(20,32)].join("-")},"makeUuidV4");var L1=class L1 extends Error{constructor(e,r,n){super(r),this.name="VpSignError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}};o(L1,"VpSignError");var er=L1,qi=o(async(t,e)=>(xT(t),t.vpFormat==="jwt_vp_json"?AT(t,e):ST(t,e)),"signPresentation"),xT=o(t=>{let{unsignedVp:e,holder:r,audience:n,nonce:i}=t;if(!e||typeof e!="object")throw new er("invalid_input","signPresentation requires an unsignedVp object");if(typeof n!="string"||n.length===0)throw new er("invalid_input","signPresentation requires a non-empty `audience`");if(typeof i!="string"||i.length===0)throw new er("invalid_input","signPresentation requires a non-empty `nonce`");if(typeof r!="string"||r.length===0)throw new er("invalid_input","signPresentation requires a non-empty `holder`");if(e.holder!==void 0&&e.holder!==r)throw new er("holder_mismatch",`unsignedVp.holder (${e.holder}) does not match options.holder (${r})`)},"validateInput"),AT=o(async(t,e)=>{if(!e.jwtSigner)throw new er("missing_jwt_signer","vpFormat=jwt_vp_json requires helpers.jwtSigner");let r=t.iat??Math.floor(Date.now()/1e3),n={alg:e.jwtSigner.alg,kid:e.jwtSigner.kid,typ:"JWT"},i=t.jti??(typeof t.unsignedVp.id=="string"?t.unsignedVp.id:void 0),s={iss:t.holder,sub:t.holder,aud:t.audience,nonce:t.nonce,iat:r,vp:t.unsignedVp};i&&(s.jti=i);let u;try{u=await e.jwtSigner.sign(n,s)}catch(a){throw new er("jwt_sign_failed",`Failed to sign jwt_vp_json: ${a instanceof Error?a.message:String(a)}`,{cause:a})}return{vpToken:u,vpFormat:"jwt_vp_json"}},"signJwtVp"),ST=o(async(t,e)=>{if(!e.ldpVpSigner)throw new er("missing_ldp_signer","vpFormat=ldp_vp requires helpers.ldpVpSigner");let r;try{r=await e.ldpVpSigner.sign(t.unsignedVp,{domain:t.audience,challenge:t.nonce})}catch(n){throw new er("ldp_sign_failed",`Failed to sign ldp_vp: ${n instanceof Error?n.message:String(n)}`,{cause:n})}return{vpToken:r,vpFormat:"ldp_vp"}},"signLdpVp");var F1=class F1 extends Error{constructor(e,r,n={}){super(r),this.name="JarmEncryptError",this.code=e,n.cause!==void 0&&(this.cause=n.cause)}};o(F1,"JarmEncryptError");var tt=F1,H1="ECDH-ES",W1="A256GCM",nh=o(async t=>{let{payload:e,clientMetadata:r,verifierNonce:n,walletNonce:i,signer:s}=t,u=r.authorization_encrypted_response_alg??H1,a=r.authorization_encrypted_response_enc??W1,c=r.authorization_signed_response_alg,d=await kT(r,t.fetchImpl),h=CT(d,u),y,b;if(c){if(!s)throw new tt("missing_signer",`Verifier requires authorization_signed_response_alg=${c} but no wallet signer was supplied`);let I=await ET(e,c,s);y=new TextEncoder().encode(I),b="JWT"}else y=new TextEncoder().encode(JSON.stringify(e)),b=void 0;let A;try{A=await dn(h,u)}catch(I){throw new tt("unsupported_alg",`Failed to import verifier encryption key (alg=${u}, kty=${h.kty}): ${gd(I)}`,{cause:I})}let S={alg:u,enc:a};typeof h.kid=="string"&&h.kid.length>0&&(S.kid=h.kid),b&&(S.cty=b);let D={apv:new TextEncoder().encode(n)};typeof i=="string"&&i.length>0&&(D.apu=new TextEncoder().encode(i));try{return await new cc(y).setProtectedHeader(S).setKeyManagementParameters(D).encrypt(A)}catch(I){throw new tt("encrypt_failed",`JWE encryption failed (alg=${u}, enc=${a}): ${gd(I)}`,{cause:I})}},"encryptResponseObject"),kT=o(async(t,e)=>{if(t.jwks&&Array.isArray(t.jwks.keys))return t.jwks.keys;if(typeof t.jwks_uri=="string"&&t.jwks_uri.length>0){let r=e??globalThis.fetch;if(typeof r!="function")throw new tt("jwks_fetch_failed",`client_metadata.jwks_uri=${t.jwks_uri} but no fetch implementation is available`);let n;try{n=await r(t.jwks_uri,{headers:{Accept:"application/json"}})}catch(s){throw new tt("jwks_fetch_failed",`Failed to fetch jwks_uri=${t.jwks_uri}: ${gd(s)}`,{cause:s})}if(!n.ok)throw new tt("jwks_fetch_failed",`jwks_uri returned HTTP ${n.status} for ${t.jwks_uri}`);let i;try{i=await n.json()}catch(s){throw new tt("invalid_jwks",`jwks_uri body was not valid JSON: ${gd(s)}`,{cause:s})}if(!i||typeof i!="object"||!Array.isArray(i.keys))throw new tt("invalid_jwks","jwks_uri body must be a JSON object with a `keys` array");return i.keys}throw new tt("no_encryption_key","client_metadata declares neither inline `jwks` nor `jwks_uri` \u2014 verifier cannot receive encrypted responses")},"resolveVerifierJwks"),CT=o((t,e)=>{if(t.length===0)throw new tt("no_encryption_key","Verifier JWKS contained no keys");let r=t.filter(s=>s.use!=="sig");if(r.length===0)throw new tt("no_encryption_key",'Verifier JWKS contains only `use:"sig"` keys; no encryption-capable key advertised');let n=r.find(s=>s.alg===e);if(n)return n;let i=r.find(s=>!s.alg);return i||r[0]},"pickEncryptionKey"),ET=o(async(t,e,r)=>{try{return await r.sign({alg:e,kid:r.kid,typ:"JWT"},t)}catch(n){throw new tt("sign_failed",`Wallet signer failed during JARM inner-JWS signing: ${gd(n)}`,{cause:n})}},"signResponse"),gd=o(t=>t instanceof Error?t.message:String(t),"describe");var z1=class z1 extends Error{constructor(e,r,n={}){super(r),this.name="VpSubmitError",this.code=e,this.status=n.status,this.body=n.body,n.cause!==void 0&&(this.cause=n.cause)}};o(z1,"VpSubmitError");var tr=z1,Fa=o(async t=>{let{responseUri:e,vpToken:r,submission:n,state:i}=t;if(typeof e!="string"||e.length===0)throw new tr("invalid_input","`responseUri` must be a non-empty string");if(r==null)throw new tr("invalid_input","`vpToken` is required");if(n!==void 0&&(n===null||typeof n!="object"))throw new tr("invalid_input","`submission` must be a PresentationSubmission object when provided (omit it entirely for DCQL flows)");let s=t.fetchImpl??globalThis.fetch;if(typeof s!="function")throw new tr("no_fetch","No fetch implementation available; pass `fetchImpl` or configure the plugin with one");let a=t.responseMode==="direct_post.jwt"?await IT({vpToken:r,submission:n,state:i,idToken:t.idToken,clientMetadata:t.clientMetadata,nonce:t.nonce,signer:t.signer,fetchImpl:s}):PT({vpToken:r,submission:n,state:i,idToken:t.idToken}),c;try{c=await s(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json, text/plain;q=0.9, */*;q=0.8"},body:a})}catch(h){throw new tr("network_error",`Failed to POST to ${e}: ${h instanceof Error?h.message:String(h)}`,{cause:h})}let d=await OT(c);if(!c.ok)throw new tr("server_error",`Verifier returned ${c.status} ${c.statusText||""}`.trim(),{status:c.status,body:d});return{status:c.status,redirectUri:RT(d),body:d}},"submitPresentation"),PT=o(t=>{let e=new URLSearchParams;return e.set("vp_token",TT(t.vpToken)),t.submission&&e.set("presentation_submission",JSON.stringify(t.submission)),typeof t.idToken=="string"&&t.idToken.length>0&&e.set("id_token",t.idToken),typeof t.state=="string"&&t.state.length>0&&e.set("state",t.state),e.toString()},"encodeFormBody"),TT=o(t=>typeof t=="string"?t:JSON.stringify(t),"stringifyVpToken"),IT=o(async t=>{if(!t.clientMetadata)throw new tr("invalid_input","response_mode=direct_post.jwt requires `clientMetadata` (verifier's JWKS + JWE algs)");if(typeof t.nonce!="string"||t.nonce.length===0)throw new tr("invalid_input","response_mode=direct_post.jwt requires the verifier `nonce` for the JWE `apv` ECDH-ES KDF input");let e={vp_token:t.vpToken};t.submission&&(e.presentation_submission=t.submission),typeof t.state=="string"&&t.state.length>0&&(e.state=t.state),typeof t.idToken=="string"&&t.idToken.length>0&&(e.id_token=t.idToken);let r;try{r=await nh({payload:e,clientMetadata:t.clientMetadata,verifierNonce:t.nonce,signer:t.signer,fetchImpl:t.fetchImpl})}catch(i){throw i instanceof tt?new tr("jarm_encrypt_failed",`Failed to build JARM response (${i.code}): ${i.message}`,{cause:i}):i}let n=new URLSearchParams;return n.set("response",r),n.toString()},"encodeJarmBody"),OT=o(async t=>{let e=await t.text().catch(()=>"");if(!e)return;if((t.headers.get("content-type")??"").includes("application/json"))try{return JSON.parse(e)}catch{return e}try{return JSON.parse(e)}catch{return e}},"parseResponseBody"),RT=o(t=>{if(t&&typeof t=="object"){let e=t.redirect_uri;if(typeof e=="string"&&e.length>0)return e}},"extractRedirectUri");var J1=class J1 extends Error{constructor(e,r,n){super(r),this.name="SiopSignError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}};o(J1,"SiopSignError");var Jn=J1,vd=o(async(t,e)=>{jT(t,e);let{holder:r,audience:n,nonce:i}=t,s=t.iat??Math.floor(Date.now()/1e3),u=s+(t.lifetimeSeconds??300),a=t.issuerMode??"did",c={alg:e.signer.alg,kid:e.signer.kid,typ:"JWT"},d={iss:a==="did"?r:"https://self-issued.me/v2",sub:r,aud:n,nonce:i,iat:s,exp:u};t.vpTokenHash&&(d._vp_token={vp_token_hash:t.vpTokenHash});let h;try{h=await e.signer.sign(c,d)}catch(y){throw new Jn("id_token_sign_failed",`Failed to sign SIOPv2 id_token: ${y instanceof Error?y.message:String(y)}`,{cause:y})}return{idToken:h}},"signIdToken"),jT=o((t,e)=>{if(!e.signer)throw new Jn("missing_signer","signIdToken requires helpers.signer");if(typeof t.holder!="string"||t.holder.length===0)throw new Jn("invalid_input","signIdToken requires a non-empty `holder`");if(typeof t.audience!="string"||t.audience.length===0)throw new Jn("invalid_input","signIdToken requires a non-empty `audience`");if(typeof t.nonce!="string"||t.nonce.length===0)throw new Jn("invalid_input","signIdToken requires a non-empty `nonce`")},"validateInput"),K1=o(t=>t?new Set(t.split(/\s+/).filter(Boolean)):new Set,"responseTypeSet"),ih=o(t=>K1(t).has("id_token"),"requiresIdToken");var G1=o(t=>{let e=t.format??DT(t.credential);if(e==="jwt_vc_json")return NT(t.credential);if(e==="ldp_vc")return BT(t.credential)},"adaptCredentialForDcql"),oh=o(t=>{let e=[];for(let r of t){let n=G1(r);n&&e.push({original:r,adapted:n})}return e},"adaptCredentialsForDcql"),NT=o(t=>{let e;if(typeof t=="string")e=a4(t);else if(t&&typeof t=="object"){let s=t.proof;if(s&&typeof s=="object"){let u=s.jwt;typeof u=="string"&&(e=a4(u))}}if(!e)return;let r=e.vc;if(!r||typeof r!="object"||Array.isArray(r))return;let n=r,i=c4(n.type);if(i.length!==0)return{credential_format:"jwt_vc_json",type:i,claims:n,cryptographic_holder_binding:!0}},"adaptJwtVc"),BT=o(t=>{if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,r=c4(e.type);if(r.length!==0)return{credential_format:"ldp_vc",type:r,claims:e,cryptographic_holder_binding:!0}},"adaptLdpVc"),c4=o(t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):typeof t=="string"?[t]:[],"extractTypes"),DT=o(t=>{if(typeof t=="string")return/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t)?"jwt_vc_json":void 0;if(t&&typeof t=="object"&&!Array.isArray(t)){let e=t.proof;if(e&&typeof e=="object")return e.type==="JwtProof2020"?"jwt_vc_json":"ldp_vc"}},"inferDcqlFormat"),a4=o(t=>{let e=t.split(".");if(e.length===3)try{let r=JSON.parse(qT(e[1]));return r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}catch{return}},"decodeJwtPayload"),qT=o(t=>{let r=(t+"=".repeat((4-t.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/");return typeof atob=="function"?atob(r):Buffer.from(r,"base64").toString("binary")},"base64UrlDecode");var sh=o((t,e)=>{let r=oh(t),n=r.map(u=>u.adapted),i=To.query(e,n),s={};for(let[u,a]of Object.entries(i.credential_matches)){if(a.success){let c=a.valid_credentials.map(d=>r[d.input_credential_index]?.original).filter(d=>d!==void 0);s[u]={credentialQueryId:u,candidates:c};continue}s[u]={credentialQueryId:u,candidates:[],reason:`No held credential satisfies query "${u}"`}}return{canSatisfy:i.can_be_satisfied,matches:s,reason:i.can_be_satisfied?void 0:"No combination of held credentials satisfies the verifier's DCQL query",raw:i}},"selectCredentialsForDcql");var X1=class X1 extends Error{constructor(e,r){super(r),this.name="BuildDcqlPresentationError",this.code=e}};o(X1,"BuildDcqlPresentationError");var Gn=X1,uh=o(t=>{let{query:e,chosen:r,holder:n}=t;if(r.length===0)throw new Gn("no_selections","buildDcqlPresentations requires at least one chosen credential");let i=t.makeId??VT,s=new Map;for(let c of r){let d=s.get(c.credentialQueryId);d?d.push(c.candidate):s.set(c.credentialQueryId,[c.candidate])}let u=new Map;for(let c of e.credentials)u.set(c.id,c);let a=[];for(let c of e.credentials){let d=s.get(c.id);d&&(a.push(MT(c,d,n,i)),s.delete(c.id))}if(s.size>0){let c=Array.from(s.keys()).join(", ");throw new Gn("unknown_credential_query",`chosen credentials reference query ids the DCQL query doesn't declare: ${c}`)}return a},"buildDcqlPresentations"),MT=o((t,e,r,n)=>{let i=UT(t.format,t.id),s=e.map((a,c)=>$T(a,t.id,c)),u={"@context":["https://www.w3.org/2018/credentials/v1"],id:`urn:uuid:${LT(n)}`,type:["VerifiablePresentation"],holder:r,verifiableCredential:s};return{credentialQueryId:t.id,unsignedVp:u,vpFormat:i,candidates:e}},"buildOnePresentation"),UT=o((t,e)=>{if(t==="jwt_vc_json")return"jwt_vp_json";if(t==="ldp_vc")return"ldp_vp";throw new Gn("unsupported_format",`DCQL query "${e}" requests format "${t}", which the plugin doesn't yet build presentations for (sd-jwt-vc and mso_mdoc are tracked for follow-up slices)`)},"vpFormatForQueryFormat"),$T=o((t,e,r)=>{let n=t.credential;if(typeof n=="string"){if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(n))return n;throw new Gn("invalid_jwt_vc",`chosen candidate at index ${r} 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 s=i.jwt;if(typeof s=="string")return s}return n}throw new Gn("invalid_jwt_vc",`chosen candidate at index ${r} for query "${e}" is neither a JWT string nor a JSON object`)},"normalizeForEmbedding"),VT=o(()=>{let t=typeof globalThis<"u"&&"crypto"in globalThis?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function"){let e=new Uint8Array(8);return t.getRandomValues(e),Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,18)},"defaultMakeId"),LT=o(t=>{let r=(t().replace(/[^0-9a-f]/gi,"")+"0".repeat(32)).slice(0,32);return[r.slice(0,8),r.slice(8,12),"4"+r.slice(13,16),(parseInt(r.slice(16,17),16)&3|8).toString(16)+r.slice(17,20),r.slice(20,32)].join("-")},"makeUuidV4");var Z1=o(async(t,e)=>{let r=[];for(let n of t.built){let i=await qi({unsignedVp:n.unsignedVp,vpFormat:n.vpFormat,audience:t.audience,nonce:t.nonce,holder:t.holder,iat:t.iat},e);r.push({credentialQueryId:n.credentialQueryId,vpToken:i.vpToken,vpFormat:n.vpFormat})}return r},"signDcqlPresentations"),ah=o(async(t,e)=>{let r=await Z1(t,e);return{vpToken:Q1(r),presentations:r}},"buildDcqlResponse"),Q1=o(t=>{let e={};for(let r of t)e[r.credentialQueryId]=r.vpToken;return e},"assembleDcqlVpToken");var d4=o((t,e={})=>{let r=e.fetch??globalThis.fetch,n={didResolver:e.didResolver,trustedX509Roots:e.trustedX509Roots,unsafeAllowSelfSigned:e.unsafeAllowSelfSignedRequestObject,unsafeSkipRequestObjectSignatureVerification:e.unsafeSkipRequestObjectSignatureVerification},i=o(async s=>{let u=xd(s);if(u.kind==="by_value")return u.offer;if(typeof r!="function")throw new we("invalid_uri","No fetch implementation available; pass `config.fetch` to getOpenID4VCPlugin()");let a=await hh(u.uri,r);if(a.kind!=="by_value")throw new we("invalid_uri","Unexpected by_reference result after resolving credential_offer_uri");return a.offer},"resolveOffer");return{name:"OpenID4VC",displayName:"OpenID4VC",description:"OpenID for Verifiable Credentials holder support \u2014 Credential Offers, VCI, VP, and SIOPv2.",methods:{parseCredentialOffer:o((s,u)=>xd(u),"parseCredentialOffer"),resolveCredentialOffer:o(async(s,u)=>i(u),"resolveCredentialOffer"),acceptCredentialOffer:o(async(s,u,a={})=>{let c=typeof u=="string"?await i(u):u,d=await rw(s,a);return Ud({offer:c,signer:d,options:a,fetchImpl:r})},"acceptCredentialOffer"),acceptAndStoreCredentialOffer:o(async(s,u,a={})=>{let c=await(async()=>{let h=typeof u=="string"?await i(u):u,y=await rw(s,a);return Ud({offer:h,signer:y,options:a,fetchImpl:r})})(),d=await fy(s,c,FT(a));return{...c,...d}},"acceptAndStoreCredentialOffer"),beginCredentialOfferAuthCode:o(async(s,u,a)=>{let c=typeof u=="string"?await i(u):u;return uy({offer:c,redirectUri:a.redirectUri,clientId:a.clientId,configurationIds:a.configurationIds,scope:a.scope,fetchImpl:r})},"beginCredentialOfferAuthCode"),completeCredentialOfferAuthCode:o(async(s,u)=>{let a=u.signer??await rw(s,{});return ay({flowHandle:u.flowHandle,code:u.code,state:u.state,signer:a,fetchImpl:r})},"completeCredentialOfferAuthCode"),parseAuthorizationRequest:o((s,u)=>ud(u),"parseAuthorizationRequest"),resolveAuthorizationRequest:o(async(s,u)=>ad(u,r,n),"resolveAuthorizationRequest"),prepareVerifiablePresentation:o(async(s,u,a)=>{let c=await za(u,r,n);if(c.dcql_query){let d=sh(a,c.dcql_query);return{request:c,dcqlSelection:d}}if(c.presentation_definition){let d=rh(a,c.presentation_definition);return{request:c,selection:d}}return{request:c,selection:{descriptors:[],canSatisfy:!0,reason:void 0}}},"prepareVerifiablePresentation"),buildPresentation:o(async(s,u,a,c={})=>{let d=await za(u,r,n),h=f4(d),y=c.holder??s.id.did(),b=md({pd:h,chosen:a,holder:y,envelopeFormat:c.envelopeFormat});return{request:d,prepared:b}},"buildPresentation"),signPresentation:o(async(s,u,a,c={})=>{let d=await za(u,r,n),h=c.holder??(typeof a.unsignedVp.holder=="string"?a.unsignedVp.holder:s.id.did());if(a.vpFormat==="jwt_vp_json"){let y=c.signer??await ch(s);return qi({unsignedVp:a.unsignedVp,vpFormat:a.vpFormat,audience:d.client_id,nonce:d.nonce,holder:h},{jwtSigner:y})}return qi({unsignedVp:a.unsignedVp,vpFormat:a.vpFormat,audience:d.client_id,nonce:d.nonce,holder:h},{ldpVpSigner:tw(s)})},"signPresentation"),submitPresentation:o(async(s,u,a,c,d={})=>{let h=await za(u,r,n),y=h.response_uri??h.redirect_uri;if(!y)throw new Error("Authorization Request has no response_uri / redirect_uri \u2014 cannot submitPresentation");return Fa({responseUri:y,vpToken:a.vpToken,submission:c,idToken:d.idToken,state:h.state,fetchImpl:r,...Y1(h,await ew(s,h))})},"submitPresentation"),signIdToken:o(async(s,u,a={})=>{let c=await za(u,r,n),d=a.holder??s.id.did(),h=a.signer??await ch(s);return vd({holder:d,audience:c.client_id,nonce:c.nonce,lifetimeSeconds:a.lifetimeSeconds,issuerMode:a.issuerMode,vpTokenHash:a.vpTokenHash},{signer:h})},"signIdToken"),presentCredentials:o(async(s,u,a,c={})=>{let d=await za(u,r,n),h=c.holder??s.id.did(),y=c.signer,b=o(async()=>(y||(y=await ch(s)),y),"ensureSharedJwtSigner"),A=o(async()=>{if(ih(d.response_type))return vd({holder:h,audience:d.client_id,nonce:d.nonce},{signer:await b()})},"signIdTokenIfRequested"),S=d.response_uri??d.redirect_uri;if(!S)throw new Error("Authorization Request has no response_uri / redirect_uri \u2014 cannot presentCredentials");if(d.dcql_query){let ve=WT(a),ce=uh({query:d.dcql_query,chosen:ve,holder:h}),Ve=ce.some(gt=>gt.vpFormat==="jwt_vp_json"),It=ce.some(gt=>gt.vpFormat==="ldp_vp"),mt={...Ve?{jwtSigner:await b()}:{},...It?{ldpVpSigner:tw(s)}:{}},Ft=await ah({built:ce,audience:d.client_id,nonce:d.nonce,holder:h},mt),Dr=await A(),sn=await Fa({responseUri:S,vpToken:Ft.vpToken,idToken:Dr?.idToken,state:d.state,fetchImpl:r,...Y1(d,await ew(s,d))});return{request:d,dcqlBuilt:ce,dcqlSigned:Ft.presentations,dcqlVpToken:Ft.vpToken,signedIdToken:Dr,submitted:sn}}let D=f4(d),I=HT(a),J=md({pd:D,chosen:I,holder:h,envelopeFormat:c.envelopeFormat}),pe=J.vpFormat==="jwt_vp_json"?{jwtSigner:await b()}:{ldpVpSigner:tw(s)},de=await qi({unsignedVp:J.unsignedVp,vpFormat:J.vpFormat,audience:d.client_id,nonce:d.nonce,holder:h},pe),xe=await A(),ee=await Fa({responseUri:S,vpToken:de.vpToken,submission:J.submission,idToken:xe?.idToken,state:d.state,fetchImpl:r,...Y1(d,await ew(s,d))});return{request:d,prepared:J,signed:de,signedIdToken:xe,submitted:ee}},"presentCredentials")}}},"getOpenID4VCPlugin"),za=o(async(t,e,r)=>typeof t=="string"?await ad(t,e,r):t,"resolveRequestInput"),f4=o(t=>{if(!t.presentation_definition)throw new Error("Authorization Request has no presentation_definition \u2014 cannot build a VP");return t.presentation_definition},"requirePresentationDefinition"),HT=o(t=>{for(let[e,r]of t.entries())if(!("descriptorId"in r)||typeof r.descriptorId!="string")throw new Error(`chosen[${e}] is missing 'descriptorId' \u2014 PEX requests need ChosenCredential entries (received DCQL-shape entry with credentialQueryId="${r.credentialQueryId}")`);return t},"assertPexChosen"),WT=o(t=>{for(let[e,r]of t.entries())if(!("credentialQueryId"in r)||typeof r.credentialQueryId!="string")throw new Error(`chosen[${e}] is missing 'credentialQueryId' \u2014 DCQL requests need DcqlChosenCredential entries (received PEX-shape entry with descriptorId="${r.descriptorId}")`);return t},"assertDcqlChosen"),Y1=o((t,e)=>t.response_mode!=="direct_post.jwt"?{}:{responseMode:"direct_post.jwt",clientMetadata:t.client_metadata,nonce:t.nonce,signer:e},"buildJarmOptions"),ew=o(async(t,e)=>{if(e.response_mode!=="direct_post.jwt")return;let r=e.client_metadata?.authorization_signed_response_alg;if(!(typeof r!="string"||r.length===0))return ch(t)},"maybeJarmSigner"),ch=o(async t=>{let e=l4(t,"VP signing"),r=t.id.did(),n=await t.invoke.didToVerificationMethod(r);return Md({keypair:e,kid:n})},"ensureVpJwtSigner"),tw=o(t=>({sign:o(async(e,{domain:r,challenge:n})=>t.invoke.issuePresentation(e,{domain:r,challenge:n}),"sign")}),"buildLdpVpSigner"),rw=o(async(t,e)=>{if(e.signer)return e.signer;let r=l4(t,"VCI proof-of-possession"),n=t.id.did(),i=await t.invoke.didToVerificationMethod(n);return Md({keypair:r,kid:i})},"ensureSigner"),l4=o((t,e)=>{let r;try{r=t.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(!r||r.kty!=="OKP"||r.crv!=="Ed25519")throw new Error(`OpenID4VC ${e} requires an Ed25519 keypair, but the host LearnCard returned ${r?`kty=${r.kty} crv=${r.crv??"<none>"}`:"no keypair"}. Pass \`options.signer\` to bring your own signer (HSM / secp256k1 / external backend).`);return r},"requireEd25519Keypair"),FT=o(t=>({storage:t.storage,encrypt:t.encrypt,category:t.category,title:t.title,imgUrl:t.imgUrl,upload:t.upload,addToIndex:t.addToIndex,makeId:t.makeId}),"splitStoreOptions");var nw=o(t=>Ni(t),"buildDcqlQuery"),p4=o(t=>{let e=t.format??"jwt_vc_json";if(t.types.length===0)throw new Error("requestW3cVc: `types` must contain at least one type string");let r={id:t.id,format:e,meta:{type_values:[Array.from(t.types)]}};return t.claims&&t.claims.length>0&&(r.claims=t.claims.map(n=>{let i={path:Array.from(n.path)};return n.values&&n.values.length>0&&(i.values=Array.from(n.values)),n.id&&(i.id=n.id),i})),t.requireHolderBinding===!1&&(r.require_cryptographic_holder_binding=!1),nw({credentials:[r]})},"requestW3cVc");
|
|
25
30
|
/*! Bundled license information:
|
|
26
31
|
|
|
27
32
|
reflect-metadata/Reflect.js:
|