@learncard/vpqr-plugin 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ "use strict";var So=Object.create;var ke=Object.defineProperty;var Oo=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Io=Object.getPrototypeOf,Ro=Object.prototype.hasOwnProperty;var a=(t,e)=>ke(t,"name",{value:e,configurable:!0});var Wt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Uo=(t,e)=>{for(var r in e)ke(t,r,{get:e[r],enumerable:!0})},Zt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Do(e))!Ro.call(t,o)&&o!==r&&ke(t,o,{get:()=>e[o],enumerable:!(n=Oo(e,o))||n.enumerable});return t};var Xt=(t,e,r)=>(r=t!=null?So(Io(t)):{},Zt(e||!t||!t.__esModule?ke(r,"default",{value:t,enumerable:!0}):r,t)),ko=t=>Zt(ke({},"__esModule",{value:!0}),t);var In=Wt((vf,Dn)=>{var Li="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Ni="0123456789ABCDEFGHIJKLMNOPQRSTUV",Pi="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Fi(t,e){var r=t.indexOf(e);if(r===-1)throw new Error("Invalid character found: "+e);return r}a(Fi,"readChar");Dn.exports=a(function(e,r){var n;switch(r){case"RFC3548":case"RFC4648":n=Li,e=e.replace(/=+$/,"");break;case"RFC4648-HEX":n=Ni,e=e.replace(/=+$/,"");break;case"Crockford":n=Pi,e=e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1");break;default:throw new Error("Unknown base32 variant: "+r)}for(var o=e.length,i=0,s=0,c=0,f=new Uint8Array(o*5/8|0),u=0;u<o;u++)s=s<<5|Fi(n,e[u]),i+=5,i>=8&&(f[c++]=s>>>i-8&255,i-=8);return f.buffer},"base32Decode")});var no=Wt((bf,mt)=>{var Rn,Un,kn,Mn,Ln,Nn,Pn,Fn,$n,jn,zn,Vn,Qn,dt,$t,Hn,Kn,Gn,De,Wn,Zn,Xn,Jn,Yn,qn,eo,to,ro,ht;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof mt=="object"&&typeof mt.exports=="object"?t(r(e,r(mt.exports))):t(r(e));function r(n,o){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,s){return n[i]=o?o(i,s):s}}a(r,"createExporter")})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};Rn=a(function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(n,o);function i(){this.constructor=n}a(i,"__"),n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},"__extends"),Un=Object.assign||function(n){for(var o,i=1,s=arguments.length;i<s;i++){o=arguments[i];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(n[c]=o[c])}return n},kn=a(function(n,o){var i={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&o.indexOf(s)<0&&(i[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,s=Object.getOwnPropertySymbols(n);c<s.length;c++)o.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(n,s[c])&&(i[s[c]]=n[s[c]]);return i},"__rest"),Mn=a(function(n,o,i,s){var c=arguments.length,f=c<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,i):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,o,i,s);else for(var d=n.length-1;d>=0;d--)(u=n[d])&&(f=(c<3?u(f):c>3?u(o,i,f):u(o,i))||f);return c>3&&f&&Object.defineProperty(o,i,f),f},"__decorate"),Ln=a(function(n,o){return function(i,s){o(i,s,n)}},"__param"),Nn=a(function(n,o,i,s,c,f){function u(j){if(j!==void 0&&typeof j!="function")throw new TypeError("Function expected");return j}a(u,"accept");for(var d=s.kind,g=d==="getter"?"get":d==="setter"?"set":"value",h=!o&&n?s.static?n:n.prototype:null,y=o||(h?Object.getOwnPropertyDescriptor(h,s.name):{}),x,v=!1,B=i.length-1;B>=0;B--){var U={};for(var F in s)U[F]=F==="access"?{}:s[F];for(var F in s.access)U.access[F]=s.access[F];U.addInitializer=function(j){if(v)throw new TypeError("Cannot add initializers after decoration has completed");f.push(u(j||null))};var $=(0,i[B])(d==="accessor"?{get:y.get,set:y.set}:y[g],U);if(d==="accessor"){if($===void 0)continue;if($===null||typeof $!="object")throw new TypeError("Object expected");(x=u($.get))&&(y.get=x),(x=u($.set))&&(y.set=x),(x=u($.init))&&c.push(x)}else(x=u($))&&(d==="field"?c.push(x):y[g]=x)}h&&Object.defineProperty(h,s.name,y),v=!0},"__esDecorate"),Pn=a(function(n,o,i){for(var s=arguments.length>2,c=0;c<o.length;c++)i=s?o[c].call(n,i):o[c].call(n);return s?i:void 0},"__runInitializers"),Fn=a(function(n){return typeof n=="symbol"?n:"".concat(n)},"__propKey"),$n=a(function(n,o,i){return typeof o=="symbol"&&(o=o.description?"[".concat(o.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:i?"".concat(i," ",o):o})},"__setFunctionName"),jn=a(function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},"__metadata"),zn=a(function(n,o,i,s){function c(f){return f instanceof i?f:new i(function(u){u(f)})}return a(c,"adopt"),new(i||(i=Promise))(function(f,u){function d(y){try{h(s.next(y))}catch(x){u(x)}}a(d,"fulfilled");function g(y){try{h(s.throw(y))}catch(x){u(x)}}a(g,"rejected");function h(y){y.done?f(y.value):c(y.value).then(d,g)}a(h,"step"),h((s=s.apply(n,o||[])).next())})},"__awaiter"),Vn=a(function(n,o){var i={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},s,c,f,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(h){return function(y){return g([h,y])}}function g(h){if(s)throw new TypeError("Generator is already executing.");for(;u&&(u=0,h[0]&&(i=0)),i;)try{if(s=1,c&&(f=h[0]&2?c.return:h[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,h[1])).done)return f;switch(c=0,f&&(h=[h[0]&2,f.value]),h[0]){case 0:case 1:f=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,c=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(f=i.trys,!(f=f.length>0&&f[f.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!f||h[1]>f[0]&&h[1]<f[3])){i.label=h[1];break}if(h[0]===6&&i.label<f[1]){i.label=f[1],f=h;break}if(f&&i.label<f[2]){i.label=f[2],i.ops.push(h);break}f[2]&&i.ops.pop(),i.trys.pop();continue}h=o.call(n,i)}catch(y){h=[6,y],c=0}finally{s=f=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},"__generator"),Qn=a(function(n,o){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&ht(o,n,i)},"__exportStar"),ht=Object.create?function(n,o,i,s){s===void 0&&(s=i);var c=Object.getOwnPropertyDescriptor(o,i);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[i]}}),Object.defineProperty(n,s,c)}:function(n,o,i,s){s===void 0&&(s=i),n[s]=o[i]},dt=a(function(n){var o=typeof Symbol=="function"&&Symbol.iterator,i=o&&n[o],s=0;if(i)return i.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),$t=a(function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var s=i.call(n),c,f=[],u;try{for(;(o===void 0||o-- >0)&&!(c=s.next()).done;)f.push(c.value)}catch(d){u={error:d}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(u)throw u.error}}return f},"__read"),Hn=a(function(){for(var n=[],o=0;o<arguments.length;o++)n=n.concat($t(arguments[o]));return n},"__spread"),Kn=a(function(){for(var n=0,o=0,i=arguments.length;o<i;o++)n+=arguments[o].length;for(var s=Array(n),c=0,o=0;o<i;o++)for(var f=arguments[o],u=0,d=f.length;u<d;u++,c++)s[c]=f[u];return s},"__spreadArrays"),Gn=a(function(n,o,i){if(i||arguments.length===2)for(var s=0,c=o.length,f;s<c;s++)(f||!(s in o))&&(f||(f=Array.prototype.slice.call(o,0,s)),f[s]=o[s]);return n.concat(f||Array.prototype.slice.call(o))},"__spreadArray"),De=a(function(n){return this instanceof De?(this.v=n,this):new De(n)},"__await"),Wn=a(function(n,o,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=i.apply(n,o||[]),c,f=[];return c={},u("next"),u("throw"),u("return"),c[Symbol.asyncIterator]=function(){return this},c;function u(v){s[v]&&(c[v]=function(B){return new Promise(function(U,F){f.push([v,B,U,F])>1||d(v,B)})})}function d(v,B){try{g(s[v](B))}catch(U){x(f[0][3],U)}}function g(v){v.value instanceof De?Promise.resolve(v.value.v).then(h,y):x(f[0][2],v)}function h(v){d("next",v)}function y(v){d("throw",v)}function x(v,B){v(B),f.shift(),f.length&&d(f[0][0],f[0][1])}},"__asyncGenerator"),Zn=a(function(n){var o,i;return o={},s("next"),s("throw",function(c){throw c}),s("return"),o[Symbol.iterator]=function(){return this},o;function s(c,f){o[c]=n[c]?function(u){return(i=!i)?{value:De(n[c](u)),done:!1}:f?f(u):u}:f}},"__asyncDelegator"),Xn=a(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof dt=="function"?dt(n):n[Symbol.iterator](),i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i);function s(f){i[f]=n[f]&&function(u){return new Promise(function(d,g){u=n[f](u),c(d,g,u.done,u.value)})}}function c(f,u,d,g){Promise.resolve(g).then(function(h){f({value:h,done:d})},u)}},"__asyncValues"),Jn=a(function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n},"__makeTemplateObject");var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};Yn=a(function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&ht(o,n,i);return r(o,n),o},"__importStar"),qn=a(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),eo=a(function(n,o,i,s){if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(n):s?s.value:o.get(n)},"__classPrivateFieldGet"),to=a(function(n,o,i,s,c){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!c:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?c.call(n,i):c?c.value=i:o.set(n,i),i},"__classPrivateFieldSet"),ro=a(function(n,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?o===n:n.has(o)},"__classPrivateFieldIn"),t("__extends",Rn),t("__assign",Un),t("__rest",kn),t("__decorate",Mn),t("__param",Ln),t("__esDecorate",Nn),t("__runInitializers",Pn),t("__propKey",Fn),t("__setFunctionName",$n),t("__metadata",jn),t("__awaiter",zn),t("__generator",Vn),t("__exportStar",Qn),t("__createBinding",ht),t("__values",dt),t("__read",$t),t("__spread",Hn),t("__spreadArrays",Kn),t("__spreadArray",Gn),t("__await",De),t("__asyncGenerator",Wn),t("__asyncDelegator",Zn),t("__asyncValues",Xn),t("__makeTemplateObject",Jn),t("__importStar",Yn),t("__importDefault",qn),t("__classPrivateFieldGet",eo),t("__classPrivateFieldSet",to),t("__classPrivateFieldIn",ro)})});var as={};Uo(as,{getVpqrPlugin:()=>ss});module.exports=ko(as);var Mo=["string","number","bigint","symbol"],Lo=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Jt(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(Mo.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(No(t))return"Buffer";let r=Po(t);return r||"Object"}a(Jt,"is");function No(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}a(No,"isBuffer");function Po(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(Lo.includes(e))return e}a(Po,"getObjectType");var l=class{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};a(l,"Type");l.uint=new l(0,"uint",!0);l.negint=new l(1,"negint",!0);l.bytes=new l(2,"bytes",!0);l.string=new l(3,"string",!0);l.array=new l(4,"array",!1);l.map=new l(5,"map",!1);l.tag=new l(6,"tag",!1);l.float=new l(7,"float",!0);l.false=new l(7,"false",!0);l.true=new l(7,"true",!0);l.null=new l(7,"null",!0);l.undefined=new l(7,"undefined",!0);l.break=new l(7,"break",!0);var p=class{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};a(p,"Token");var be=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Fo=new TextDecoder,$o=new TextEncoder;function We(t){return be&&globalThis.Buffer.isBuffer(t)}a(We,"isBuffer");function xt(t){return t instanceof Uint8Array?We(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}a(xt,"asU8A");var tr=be?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):qt(t,e,r):(t,e,r)=>r-e>64?Fo.decode(t.subarray(e,r)):qt(t,e,r),rr=be?t=>t.length>64?globalThis.Buffer.from(t):Yt(t):t=>t.length>64?$o.encode(t):Yt(t),G=a(t=>Uint8Array.from(t),"fromArray"),Ee=be?(t,e,r)=>We(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),nr=be?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),xt(globalThis.Buffer.concat(t,e))):(t,e)=>{let r=new Uint8Array(e),n=0;for(let o of t)n+o.length>r.length&&(o=o.subarray(0,r.length-n)),r.set(o,n),n+=o.length;return r},or=be?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function ir(t,e){if(We(t)&&We(e))return t.compare(e);for(let r=0;r<t.length;r++)if(t[r]!==e[r])return t[r]<e[r]?-1:1;return 0}a(ir,"compare");function Yt(t,e=1/0){let r,n=t.length,o=null,i=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}a(Yt,"utf8ToBytes");function qt(t,e,r){let n=[];for(;e<r;){let o=t[e],i=null,s=o>239?4:o>223?3:o>191?2:1;if(e+s<=r){let c,f,u,d;switch(s){case 1:o<128&&(i=o);break;case 2:c=t[e+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(i=d));break;case 3:c=t[e+1],f=t[e+2],(c&192)===128&&(f&192)===128&&(d=(o&15)<<12|(c&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(i=d));break;case 4:c=t[e+1],f=t[e+2],u=t[e+3],(c&192)===128&&(f&192)===128&&(u&192)===128&&(d=(o&15)<<18|(c&63)<<12|(f&63)<<6|u&63,d>65535&&d<1114112&&(i=d))}}i===null?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),e+=s}return jo(n)}a(qt,"utf8Slice");var er=4096;function jo(t){let e=t.length;if(e<=er)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=er));return r}a(jo,"decodeCodePointsArray");var zo=256,Te=class{constructor(e=zo){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let r=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let o=r.length-(this.maxCursor-this.cursor)-1;r.set(e,o)}else{if(r){let o=r.length-(this.maxCursor-this.cursor)-1;o<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,o),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(r=or(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=Ee(n,0,this.cursor)}else r=nr(this.chunks,this.cursor);return e&&this.reset(),r}};a(Te,"Bl");var w="CBOR decode error:",vt="CBOR encode error:",Me=[];Me[23]=1;Me[24]=2;Me[25]=3;Me[26]=5;Me[27]=9;function Z(t,e,r){if(t.length-e<r)throw new Error(`${w} not enough data for type`)}a(Z,"assertEnoughData");var C=[24,256,65536,4294967296,BigInt("18446744073709551616")];function k(t,e,r){Z(t,e,1);let n=t[e];if(r.strict===!0&&n<C[0])throw new Error(`${w} integer encoded in more bytes than necessary (strict decode)`);return n}a(k,"readUint8");function M(t,e,r){Z(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<C[1])throw new Error(`${w} integer encoded in more bytes than necessary (strict decode)`);return n}a(M,"readUint16");function L(t,e,r){Z(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<C[2])throw new Error(`${w} integer encoded in more bytes than necessary (strict decode)`);return n}a(L,"readUint32");function N(t,e,r){Z(t,e,8);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3],o=t[e+4]*16777216+(t[e+5]<<16)+(t[e+6]<<8)+t[e+7],i=(BigInt(n)<<BigInt(32))+BigInt(o);if(r.strict===!0&&i<C[3])throw new Error(`${w} integer encoded in more bytes than necessary (strict decode)`);if(i<=Number.MAX_SAFE_INTEGER)return Number(i);if(r.allowBigInt===!0)return i;throw new Error(`${w} integers outside of the safe integer range are not supported`)}a(N,"readUint64");function sr(t,e,r,n){return new p(l.uint,k(t,e+1,n),2)}a(sr,"decodeUint8");function ar(t,e,r,n){return new p(l.uint,M(t,e+1,n),3)}a(ar,"decodeUint16");function cr(t,e,r,n){return new p(l.uint,L(t,e+1,n),5)}a(cr,"decodeUint32");function fr(t,e,r,n){return new p(l.uint,N(t,e+1,n),9)}a(fr,"decodeUint64");function z(t,e){return S(t,0,e.value)}a(z,"encodeUint");function S(t,e,r){if(r<C[0]){let n=Number(r);t.push([e|n])}else if(r<C[1]){let n=Number(r);t.push([e|24,n])}else if(r<C[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<C[3]){let n=Number(r);t.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<C[4]){let o=[e|27,0,0,0,0,0,0,0],i=Number(n&BigInt(4294967295)),s=Number(n>>BigInt(32)&BigInt(4294967295));o[8]=i&255,i=i>>8,o[7]=i&255,i=i>>8,o[6]=i&255,i=i>>8,o[5]=i&255,o[4]=s&255,s=s>>8,o[3]=s&255,s=s>>8,o[2]=s&255,s=s>>8,o[1]=s&255,t.push(o)}else throw new Error(`${w} encountered BigInt larger than allowable range`)}}a(S,"encodeUintValue");z.encodedSize=a(function(e){return S.encodedSize(e.value)},"encodedSize");S.encodedSize=a(function(e){return e<C[0]?1:e<C[1]?2:e<C[2]?3:e<C[3]?5:9},"encodedSize");z.compareTokens=a(function(e,r){return e.value<r.value?-1:e.value>r.value?1:0},"compareTokens");function ur(t,e,r,n){return new p(l.negint,-1-k(t,e+1,n),2)}a(ur,"decodeNegint8");function lr(t,e,r,n){return new p(l.negint,-1-M(t,e+1,n),3)}a(lr,"decodeNegint16");function pr(t,e,r,n){return new p(l.negint,-1-L(t,e+1,n),5)}a(pr,"decodeNegint32");var _t=BigInt(-1),dr=BigInt(1);function hr(t,e,r,n){let o=N(t,e+1,n);if(typeof o!="bigint"){let i=-1-o;if(i>=Number.MIN_SAFE_INTEGER)return new p(l.negint,i,9)}if(n.allowBigInt!==!0)throw new Error(`${w} integers outside of the safe integer range are not supported`);return new p(l.negint,_t-BigInt(o),9)}a(hr,"decodeNegint64");function Ze(t,e){let r=e.value,n=typeof r=="bigint"?r*_t-dr:r*-1-1;S(t,e.type.majorEncoded,n)}a(Ze,"encodeNegint");Ze.encodedSize=a(function(e){let r=e.value,n=typeof r=="bigint"?r*_t-dr:r*-1-1;return n<C[0]?1:n<C[1]?2:n<C[2]?3:n<C[3]?5:9},"encodedSize");Ze.compareTokens=a(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function Le(t,e,r,n){Z(t,e,r+n);let o=Ee(t,e+r,e+r+n);return new p(l.bytes,o,r+n)}a(Le,"toToken");function mr(t,e,r,n){return Le(t,e,1,r)}a(mr,"decodeBytesCompact");function yr(t,e,r,n){return Le(t,e,2,k(t,e+1,n))}a(yr,"decodeBytes8");function gr(t,e,r,n){return Le(t,e,3,M(t,e+1,n))}a(gr,"decodeBytes16");function wr(t,e,r,n){return Le(t,e,5,L(t,e+1,n))}a(wr,"decodeBytes32");function xr(t,e,r,n){let o=N(t,e+1,n);if(typeof o=="bigint")throw new Error(`${w} 64-bit integer bytes lengths not supported`);return Le(t,e,9,o)}a(xr,"decodeBytes64");function Xe(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===l.string?rr(t.value):t.value),t.encodedBytes}a(Xe,"tokenBytes");function Ae(t,e){let r=Xe(e);S(t,e.type.majorEncoded,r.length),t.push(r)}a(Ae,"encodeBytes");Ae.encodedSize=a(function(e){let r=Xe(e);return S.encodedSize(r.length)+r.length},"encodedSize");Ae.compareTokens=a(function(e,r){return Qo(Xe(e),Xe(r))},"compareTokens");function Qo(t,e){return t.length<e.length?-1:t.length>e.length?1:ir(t,e)}a(Qo,"compareBytes");function Ne(t,e,r,n,o){let i=r+n;Z(t,e,i);let s=new p(l.string,tr(t,e+r,e+i),i);return o.retainStringBytes===!0&&(s.byteValue=Ee(t,e+r,e+i)),s}a(Ne,"toToken");function vr(t,e,r,n){return Ne(t,e,1,r,n)}a(vr,"decodeStringCompact");function _r(t,e,r,n){return Ne(t,e,2,k(t,e+1,n),n)}a(_r,"decodeString8");function br(t,e,r,n){return Ne(t,e,3,M(t,e+1,n),n)}a(br,"decodeString16");function Er(t,e,r,n){return Ne(t,e,5,L(t,e+1,n),n)}a(Er,"decodeString32");function Tr(t,e,r,n){let o=N(t,e+1,n);if(typeof o=="bigint")throw new Error(`${w} 64-bit integer string lengths not supported`);return Ne(t,e,9,o,n)}a(Tr,"decodeString64");var Ar=Ae;function Ce(t,e,r,n){return new p(l.array,n,r)}a(Ce,"toToken");function Cr(t,e,r,n){return Ce(t,e,1,r)}a(Cr,"decodeArrayCompact");function Br(t,e,r,n){return Ce(t,e,2,k(t,e+1,n))}a(Br,"decodeArray8");function Sr(t,e,r,n){return Ce(t,e,3,M(t,e+1,n))}a(Sr,"decodeArray16");function Or(t,e,r,n){return Ce(t,e,5,L(t,e+1,n))}a(Or,"decodeArray32");function Dr(t,e,r,n){let o=N(t,e+1,n);if(typeof o=="bigint")throw new Error(`${w} 64-bit integer array lengths not supported`);return Ce(t,e,9,o)}a(Dr,"decodeArray64");function Ir(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${w} indefinite length items not allowed`);return Ce(t,e,1,1/0)}a(Ir,"decodeArrayIndefinite");function Je(t,e){S(t,l.array.majorEncoded,e.value)}a(Je,"encodeArray");Je.compareTokens=z.compareTokens;Je.encodedSize=a(function(e){return S.encodedSize(e.value)},"encodedSize");function Be(t,e,r,n){return new p(l.map,n,r)}a(Be,"toToken");function Rr(t,e,r,n){return Be(t,e,1,r)}a(Rr,"decodeMapCompact");function Ur(t,e,r,n){return Be(t,e,2,k(t,e+1,n))}a(Ur,"decodeMap8");function kr(t,e,r,n){return Be(t,e,3,M(t,e+1,n))}a(kr,"decodeMap16");function Mr(t,e,r,n){return Be(t,e,5,L(t,e+1,n))}a(Mr,"decodeMap32");function Lr(t,e,r,n){let o=N(t,e+1,n);if(typeof o=="bigint")throw new Error(`${w} 64-bit integer map lengths not supported`);return Be(t,e,9,o)}a(Lr,"decodeMap64");function Nr(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${w} indefinite length items not allowed`);return Be(t,e,1,1/0)}a(Nr,"decodeMapIndefinite");function Ye(t,e){S(t,l.map.majorEncoded,e.value)}a(Ye,"encodeMap");Ye.compareTokens=z.compareTokens;Ye.encodedSize=a(function(e){return S.encodedSize(e.value)},"encodedSize");function Pr(t,e,r,n){return new p(l.tag,r,1)}a(Pr,"decodeTagCompact");function Fr(t,e,r,n){return new p(l.tag,k(t,e+1,n),2)}a(Fr,"decodeTag8");function $r(t,e,r,n){return new p(l.tag,M(t,e+1,n),3)}a($r,"decodeTag16");function jr(t,e,r,n){return new p(l.tag,L(t,e+1,n),5)}a(jr,"decodeTag32");function zr(t,e,r,n){return new p(l.tag,N(t,e+1,n),9)}a(zr,"decodeTag64");function qe(t,e){S(t,l.tag.majorEncoded,e.value)}a(qe,"encodeTag");qe.compareTokens=z.compareTokens;qe.encodedSize=a(function(e){return S.encodedSize(e.value)},"encodedSize");var Xo=20,Jo=21,Yo=22,qo=23;function Vr(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${w} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new p(l.null,null,1):new p(l.undefined,void 0,1)}a(Vr,"decodeUndefined");function Qr(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${w} indefinite length items not allowed`);return new p(l.break,void 0,1)}a(Qr,"decodeBreak");function bt(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${w} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${w} Infinity values are not supported`)}return new p(l.float,t,e)}a(bt,"createToken");function Hr(t,e,r,n){return bt(Et(t,e+1),3,n)}a(Hr,"decodeFloat16");function Kr(t,e,r,n){return bt(Tt(t,e+1),5,n)}a(Kr,"decodeFloat32");function Gr(t,e,r,n){return bt(Jr(t,e+1),9,n)}a(Gr,"decodeFloat64");function et(t,e,r){let n=e.value;if(n===!1)t.push([l.float.majorEncoded|Xo]);else if(n===!0)t.push([l.float.majorEncoded|Jo]);else if(n===null)t.push([l.float.majorEncoded|Yo]);else if(n===void 0)t.push([l.float.majorEncoded|qo]);else{let o,i=!1;(!r||r.float64!==!0)&&(Zr(n),o=Et(Q,1),n===o||Number.isNaN(n)?(Q[0]=249,t.push(Q.slice(0,3)),i=!0):(Xr(n),o=Tt(Q,1),n===o&&(Q[0]=250,t.push(Q.slice(0,5)),i=!0))),i||(ei(n),o=Jr(Q,1),Q[0]=251,t.push(Q.slice(0,9)))}}a(et,"encodeFloat");et.encodedSize=a(function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Zr(n);let o=Et(Q,1);if(n===o||Number.isNaN(n))return 3;if(Xr(n),o=Tt(Q,1),n===o)return 5}return 9},"encodedSize");var Wr=new ArrayBuffer(9),V=new DataView(Wr,1),Q=new Uint8Array(Wr,0);function Zr(t){if(t===1/0)V.setUint16(0,31744,!1);else if(t===-1/0)V.setUint16(0,64512,!1);else if(Number.isNaN(t))V.setUint16(0,32256,!1);else{V.setFloat32(0,t);let e=V.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)V.setUint16(0,31744,!1);else if(r===0)V.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?V.setUint16(0,0):o<-14?V.setUint16(0,(e&2147483648)>>16|1<<24+o,!1):V.setUint16(0,(e&2147483648)>>16|o+15<<10|n>>13,!1)}}}a(Zr,"encodeFloat16");function Et(t,e){if(t.length-e<2)throw new Error(`${w} not enough data for float16`);let r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,o=r&1023,i;return n===0?i=o*2**-24:n!==31?i=(o+1024)*2**(n-25):i=o===0?1/0:NaN,r&32768?-i:i}a(Et,"readFloat16");function Xr(t){V.setFloat32(0,t,!1)}a(Xr,"encodeFloat32");function Tt(t,e){if(t.length-e<4)throw new Error(`${w} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}a(Tt,"readFloat32");function ei(t){V.setFloat64(0,t,!1)}a(ei,"encodeFloat64");function Jr(t,e){if(t.length-e<8)throw new Error(`${w} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}a(Jr,"readFloat64");et.compareTokens=z.compareTokens;function _(t,e,r){throw new Error(`${w} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}a(_,"invalidMinor");function tt(t){return()=>{throw new Error(`${w} ${t}`)}}a(tt,"errorer");var m=[];for(let t=0;t<=23;t++)m[t]=_;m[24]=sr;m[25]=ar;m[26]=cr;m[27]=fr;m[28]=_;m[29]=_;m[30]=_;m[31]=_;for(let t=32;t<=55;t++)m[t]=_;m[56]=ur;m[57]=lr;m[58]=pr;m[59]=hr;m[60]=_;m[61]=_;m[62]=_;m[63]=_;for(let t=64;t<=87;t++)m[t]=mr;m[88]=yr;m[89]=gr;m[90]=wr;m[91]=xr;m[92]=_;m[93]=_;m[94]=_;m[95]=tt("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)m[t]=vr;m[120]=_r;m[121]=br;m[122]=Er;m[123]=Tr;m[124]=_;m[125]=_;m[126]=_;m[127]=tt("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)m[t]=Cr;m[152]=Br;m[153]=Sr;m[154]=Or;m[155]=Dr;m[156]=_;m[157]=_;m[158]=_;m[159]=Ir;for(let t=160;t<=183;t++)m[t]=Rr;m[184]=Ur;m[185]=kr;m[186]=Mr;m[187]=Lr;m[188]=_;m[189]=_;m[190]=_;m[191]=Nr;for(let t=192;t<=215;t++)m[t]=Pr;m[216]=Fr;m[217]=$r;m[218]=jr;m[219]=zr;m[220]=_;m[221]=_;m[222]=_;m[223]=_;for(let t=224;t<=243;t++)m[t]=tt("simple values are not supported");m[244]=_;m[245]=_;m[246]=_;m[247]=Vr;m[248]=tt("simple values are not supported");m[249]=Hr;m[250]=Kr;m[251]=Gr;m[252]=_;m[253]=_;m[254]=_;m[255]=Qr;var H=[];for(let t=0;t<24;t++)H[t]=new p(l.uint,t,1);for(let t=-1;t>=-24;t--)H[31-t]=new p(l.negint,t,1);H[64]=new p(l.bytes,new Uint8Array(0),1);H[96]=new p(l.string,"",1);H[128]=new p(l.array,0,1);H[160]=new p(l.map,0,1);H[244]=new p(l.false,!1,1);H[245]=new p(l.true,!0,1);H[246]=new p(l.null,null,1);function Yr(t){switch(t.type){case l.false:return G([244]);case l.true:return G([245]);case l.null:return G([246]);case l.bytes:return t.value.length?void 0:G([64]);case l.string:return t.value===""?G([96]):void 0;case l.array:return t.value===0?G([128]):void 0;case l.map:return t.value===0?G([160]):void 0;case l.uint:return t.value<24?G([Number(t.value)]):void 0;case l.negint:if(t.value>=-24)return G([31-Number(t.value)])}}a(Yr,"quickEncodeToken");var ri={float64:!1,mapSorter:ii,quickEncodeToken:Yr};function ni(){let t=[];return t[l.uint.major]=z,t[l.negint.major]=Ze,t[l.bytes.major]=Ae,t[l.string.major]=Ar,t[l.array.major]=Je,t[l.map.major]=Ye,t[l.tag.major]=qe,t[l.float.major]=et,t}a(ni,"makeCborEncoders");var qr=ni(),At=new Te,le=class{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${vt} object contains circular references`);return new le(r,e)}};a(le,"Ref");var J={null:new p(l.null,null),undefined:new p(l.undefined,void 0),true:new p(l.true,!0),false:new p(l.false,!1),emptyArray:new p(l.array,0),emptyMap:new p(l.map,0)},Y={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new p(l.float,t):t>=0?new p(l.uint,t):new p(l.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new p(l.uint,t):new p(l.negint,t)},Uint8Array(t,e,r,n){return new p(l.bytes,t)},string(t,e,r,n){return new p(l.string,t)},boolean(t,e,r,n){return t?J.true:J.false},null(t,e,r,n){return J.null},undefined(t,e,r,n){return J.undefined},ArrayBuffer(t,e,r,n){return new p(l.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new p(l.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[J.emptyArray,new p(l.break)]:J.emptyArray;n=le.createCheck(n,t);let o=[],i=0;for(let s of t)o[i++]=rt(s,r,n);return r.addBreakTokens?[new p(l.array,t.length),o,new p(l.break)]:[new p(l.array,t.length),o]},Object(t,e,r,n){let o=e!=="Object",i=o?t.keys():Object.keys(t),s=o?t.size:i.length;if(!s)return r.addBreakTokens===!0?[J.emptyMap,new p(l.break)]:J.emptyMap;n=le.createCheck(n,t);let c=[],f=0;for(let u of i)c[f++]=[rt(u,r,n),rt(o?t.get(u):t[u],r,n)];return oi(c,r),r.addBreakTokens?[new p(l.map,s),c,new p(l.break)]:[new p(l.map,s),c]}};Y.Map=Y.Object;Y.Buffer=Y.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Y[`${t}Array`]=Y.DataView;function rt(t,e={},r){let n=Jt(t),o=e&&e.typeEncoders&&e.typeEncoders[n]||Y[n];if(typeof o=="function"){let s=o(t,n,e,r);if(s!=null)return s}let i=Y[n];if(!i)throw new Error(`${vt} unsupported type: ${n}`);return i(t,n,e,r)}a(rt,"objectToTokens");function oi(t,e){e.mapSorter&&t.sort(e.mapSorter)}a(oi,"sortMapEntries");function ii(t,e){let r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);let o=r.type.major,i=qr[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}a(ii,"mapSorter");function en(t,e,r,n){if(Array.isArray(e))for(let o of e)en(t,o,r,n);else r[e.type.major](t,e,n)}a(en,"tokensToEncoded");function si(t,e,r){let n=rt(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){let o=r.quickEncodeToken(n);if(o)return o;let i=e[n.type.major];if(i.encodedSize){let s=i.encodedSize(n,r),c=new Te(s);if(i(c,n,r),c.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return xt(c.chunks[0])}}return At.reset(),en(At,n,e,r),At.toBytes(!0)}a(si,"encodeCustom");function Pe(t,e){return e=Object.assign({},ri,e),si(t,qr,e)}a(Pe,"encode");var ai={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},nt=class{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],r=H[e];if(r===void 0){let n=m[e];if(!n)throw new Error(`${w} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let o=e&31;r=n(this.data,this.pos,o,this.options)}return this.pos+=r.encodedLength,r}};a(nt,"Tokeniser");var Fe=Symbol.for("DONE"),ot=Symbol.for("BREAK");function ci(t,e,r){let n=[];for(let o=0;o<t.value;o++){let i=$e(e,r);if(i===ot){if(t.value===1/0)break;throw new Error(`${w} got unexpected break to lengthed array`)}if(i===Fe)throw new Error(`${w} found array but not enough entries (got ${o}, expected ${t.value})`);n[o]=i}return n}a(ci,"tokenToArray");function fi(t,e,r){let n=r.useMaps===!0,o=n?void 0:{},i=n?new Map:void 0;for(let s=0;s<t.value;s++){let c=$e(e,r);if(c===ot){if(t.value===1/0)break;throw new Error(`${w} got unexpected break to lengthed map`)}if(c===Fe)throw new Error(`${w} found map but not enough entries (got ${s} [no key], expected ${t.value})`);if(n!==!0&&typeof c!="string")throw new Error(`${w} non-string keys not supported (got ${typeof c})`);if(r.rejectDuplicateMapKeys===!0&&(n&&i.has(c)||!n&&c in o))throw new Error(`${w} found repeat map key "${c}"`);let f=$e(e,r);if(f===Fe)throw new Error(`${w} found map but not enough entries (got ${s} [no value], expected ${t.value})`);n?i.set(c,f):o[c]=f}return n?i:o}a(fi,"tokenToMap");function $e(t,e){if(t.done())return Fe;let r=t.next();if(r.type===l.break)return ot;if(r.type.terminal)return r.value;if(r.type===l.array)return ci(r,t,e);if(r.type===l.map)return fi(r,t,e);if(r.type===l.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=$e(t,e);return e.tags[r.value](n)}throw new Error(`${w} tag not supported (${r.value})`)}throw new Error("unsupported")}a($e,"tokensToObject");function je(t,e){if(!(t instanceof Uint8Array))throw new Error(`${w} data to decode must be a Uint8Array`);e=Object.assign({},ai,e);let r=e.tokenizer||new nt(t,e),n=$e(r,e);if(n===Fe)throw new Error(`${w} did not find any content to decode`);if(n===ot)throw new Error(`${w} got unexpected break`);if(!r.done())throw new Error(`${w} too many terminals, data makes no sense`);return n}a(je,"decode");var E=class extends Error{constructor(e,r){super(),this.message=r,this.value=e,this.stack=new Error(`${e}: ${r}`).stack,this.name=this.constructor.name}};a(E,"CborldError");var A=class{decode({value:e}={}){throw new Error("Must be implemented by derived class.")}static createDecoder({value:e,transformer:r}={}){throw new Error("Must be implemented by derived class.")}};a(A,"CborldDecoder");var Ct=new Map,Bt=new Map;O(16,"https://www.w3.org/ns/activitystreams");O(17,"https://www.w3.org/2018/credentials/v1");O(18,"https://www.w3.org/ns/did/v1");O(19,"https://w3id.org/security/suites/ed25519-2018/v1");O(20,"https://w3id.org/security/suites/ed25519-2020/v1");O(21,"https://w3id.org/cit/v1");O(22,"https://w3id.org/age/v1");O(23,"https://w3id.org/security/suites/x25519-2020/v1");O(24,"https://w3id.org/veres-one/v1");O(25,"https://w3id.org/webkms/v1");O(26,"https://w3id.org/zcap/v1");O(27,"https://w3id.org/security/suites/hmac-2019/v1");O(28,"https://w3id.org/security/suites/aes-2019/v1");O(29,"https://w3id.org/vaccination/v1");O(30,"https://w3id.org/vc-revocation-list-2020/v1");O(31,"https://w3id.org/dcc/v1c");O(32,"https://w3id.org/vc/status-list/v1");function O(t,e){Bt.set(e,t),Ct.set(t,e)}a(O,"_addRegistration");var q=class extends A{constructor({reverseAppContextMap:e}={}){super(),this.reverseAppContextMap=e}decode({value:e}={}){if(typeof e!="number")return St(e);let r=Ct.get(e)||this.reverseAppContextMap.get(e);if(r===void 0)throw new E("ERR_UNDEFINED_COMPRESSED_CONTEXT",`Undefined compressed context "${e}".`);return r}static createDecoder({transformer:e}={}){let{reverseAppContextMap:r}=e;return new q({reverseAppContextMap:r})}};a(q,"ContextDecoder");function St(t){if(Array.isArray(t))return t.map(St);if(!(t instanceof Map))return t;let e={};for(let[r,n]of t)e[r]=St(n);return e}a(St,"_mapToObject");var an="3.7.5",ui=an,li=typeof atob=="function",pi=typeof btoa=="function",Oe=typeof Buffer=="function",tn=typeof TextDecoder=="function"?new TextDecoder:void 0,rn=typeof TextEncoder=="function"?new TextEncoder:void 0,di="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ze=Array.prototype.slice.call(di),st=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(ze),hi=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,D=String.fromCharCode.bind(String),nn=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),cn=a(t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),"_mkUriSafe"),fn=a(t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),"_tidyB64"),un=a(t=>{let e,r,n,o,i="",s=t.length%3;for(let c=0;c<t.length;){if((r=t.charCodeAt(c++))>255||(n=t.charCodeAt(c++))>255||(o=t.charCodeAt(c++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|o,i+=ze[e>>18&63]+ze[e>>12&63]+ze[e>>6&63]+ze[e&63]}return s?i.slice(0,s-3)+"===".substring(s):i},"btoaPolyfill"),It=pi?t=>btoa(t):Oe?t=>Buffer.from(t,"binary").toString("base64"):un,Ot=Oe?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,o=t.length;n<o;n+=4096)r.push(D.apply(null,t.subarray(n,n+4096)));return It(r.join(""))},at=a((t,e=!1)=>e?cn(Ot(t)):Ot(t),"fromUint8Array"),mi=a(t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?D(192|e>>>6)+D(128|e&63):D(224|e>>>12&15)+D(128|e>>>6&63)+D(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return D(240|e>>>18&7)+D(128|e>>>12&63)+D(128|e>>>6&63)+D(128|e&63)}},"cb_utob"),yi=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ln=a(t=>t.replace(yi,mi),"utob"),on=Oe?t=>Buffer.from(t,"utf8").toString("base64"):rn?t=>Ot(rn.encode(t)):t=>It(ln(t)),Se=a((t,e=!1)=>e?cn(on(t)):on(t),"encode"),sn=a(t=>Se(t,!0),"encodeURI"),gi=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,wi=a(t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return D((r>>>10)+55296)+D((r&1023)+56320);case 3:return D((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return D((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},"cb_btou"),pn=a(t=>t.replace(gi,wi),"btou"),dn=a(t=>{if(t=t.replace(/\s+/g,""),!hi.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,o;for(let i=0;i<t.length;)e=st[t.charAt(i++)]<<18|st[t.charAt(i++)]<<12|(n=st[t.charAt(i++)])<<6|(o=st[t.charAt(i++)]),r+=n===64?D(e>>16&255):o===64?D(e>>16&255,e>>8&255):D(e>>16&255,e>>8&255,e&255);return r},"atobPolyfill"),Rt=li?t=>atob(fn(t)):Oe?t=>Buffer.from(t,"base64").toString("binary"):dn,hn=Oe?t=>nn(Buffer.from(t,"base64")):t=>nn(Rt(t).split("").map(e=>e.charCodeAt(0))),mn=a(t=>hn(yn(t)),"toUint8Array"),xi=Oe?t=>Buffer.from(t,"base64").toString("utf8"):tn?t=>tn.decode(hn(t)):t=>pn(Rt(t)),yn=a(t=>fn(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),"_unURI"),Dt=a(t=>xi(yn(t)),"decode"),vi=a(t=>{if(typeof t!="string")return!1;let e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},"isValid"),gn=a(t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),"_noEnum"),wn=a(function(){let t=a((e,r)=>Object.defineProperty(String.prototype,e,gn(r)),"_add");t("fromBase64",function(){return Dt(this)}),t("toBase64",function(e){return Se(this,e)}),t("toBase64URI",function(){return Se(this,!0)}),t("toBase64URL",function(){return Se(this,!0)}),t("toUint8Array",function(){return mn(this)})},"extendString"),xn=a(function(){let t=a((e,r)=>Object.defineProperty(Uint8Array.prototype,e,gn(r)),"_add");t("toBase64",function(e){return at(this,e)}),t("toBase64URI",function(){return at(this,!0)}),t("toBase64URL",function(){return at(this,!0)})},"extendUint8Array"),_i=a(()=>{wn(),xn()},"extendBuiltins"),ct={version:an,VERSION:ui,atob:Rt,atobPolyfill:dn,btoa:It,btoaPolyfill:un,fromBase64:Dt,toBase64:Se,encode:Se,encodeURI:sn,encodeURL:sn,utob:ln,btou:pn,decode:Dt,isValid:vi,fromUint8Array:at,toUint8Array:mn,extendString:wn,extendUint8Array:xn,extendBuiltins:_i};var vn={};function _n(t,e,r){if(!(t instanceof Uint8Array))throw new TypeError('"input" must be a Uint8Array.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');if(t.length===0)return"";let n="",o=0,i=e.length,s=e.charAt(0),c=[0];for(o=0;o<t.length;++o){let f=t[o];for(let u=0;u<c.length;++u)f+=c[u]<<8,c[u]=f%i,f=f/i|0;for(;f>0;)c.push(f%i),f=f/i|0}for(o=0;t[o]===0&&o<t.length-1;++o)n+=s;for(o=c.length-1;o>=0;--o)n+=e[c[o]];if(r){let f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join(`\r
2
+ `)}return n}a(_n,"encode");function bn(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t.length===0)return new Uint8Array;let r=vn[e];if(!r){r=vn[e]=[];for(let s=0;s<e.length;++s)r[e.charCodeAt(s)]=s}t=t.replace(/\s/g,"");let n=e.length,o=e.charAt(0),i=[0];for(let s=0;s<t.length;s++){let c=r[t.charCodeAt(s)];if(c===void 0)return;let f=c;for(let u=0;u<i.length;++u)f+=i[u]*n,i[u]=f&255,f>>=8;for(;f>0;)i.push(f&255),f>>=8}for(let s=0;t[s]===o&&s<t.length-1;++s)i.push(0);return new Uint8Array(i.reverse())}a(bn,"decode");var En="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function Ve(t,e){return _n(t,En,e)}a(Ve,"encode");function ft(t){return bn(t,En)}a(ft,"decode");var pe=class extends A{decode({value:e}={}){let{buffer:r,byteOffset:n,length:o}=e,i=new Uint8Array(r,n+1,o-1);return e[0]===122?`z${Ve(i)}`:e[0]===77?`M${ct.fromUint8Array(i)}`:e}static createDecoder({value:e}={}){if(!(e instanceof Uint8Array))return!1;if(e[0]===122||e[0]===77)return new pe}};a(pe,"MultibaseDecoder");var K=new Map([["@context",0],["@type",2],["@id",4],["@value",6],["@direction",8],["@graph",10],["@included",12],["@index",14],["@json",16],["@language",18],["@list",20],["@nest",22],["@reverse",24],["@base",26],["@container",28],["@default",30],["@embed",32],["@explicit",34],["@none",36],["@omitDefault",38],["@prefix",40],["@preserve",42],["@protected",44],["@requireAll",46],["@set",48],["@version",50],["@vocab",52]]),ut=100;var de=class{constructor({appContextMap:e,documentLoader:r}={}){this.appContextMap=e,this.documentLoader=r}_beforeObjectContexts(){}_afterObjectContexts(){}_beforeTypeScopedContexts(){}async _transform({obj:e,transformMap:r,contextStack:n=[]}){this._beforeObjectContexts({obj:e,transformMap:r});let o=await this._applyEmbeddedContexts({obj:e,contextStack:n});this._afterObjectContexts({obj:e,transformMap:r});let i=n.slice();this._beforeTypeScopedContexts({activeCtx:o,obj:e,transformMap:r}),o=await this._applyTypeScopedContexts({obj:e,contextStack:n});let{aliases:s,scopedContextMap:c,termMap:f}=o,u=this._getEntries({obj:e,transformMap:r,transformer:this,termMap:f});for(let[d,g]of u){let{term:h}=d;if(h==="@id"||s.id.has(h)){this._transformObjectId({obj:e,transformMap:r,termInfo:d,value:g});continue}if(h==="@type"||s.type.has(h)){this._transformObjectType({obj:e,transformMap:r,termInfo:d,value:g});continue}let y=i,x,v=c.get(h);v&&(x=await this._applyEmbeddedContexts({obj:{"@context":v},contextStack:n}),y=n.slice());let{plural:B,def:U}=d,F=this._getTermType({activeCtx:x||o,def:U}),$=B?g:[g],j=[];for(let fe of $){if(fe===null){j.push(null);continue}if(!this._transformTypedValue({entries:j,termType:F,value:fe,termInfo:d})){if(typeof fe!="object"){j.push(fe);continue}if(Array.isArray(fe)){await this._transformArray({entries:j,contextStack:y,value:fe});continue}await this._transformObject({entries:j,contextStack:y,value:fe})}}x&&x.revert(),this._assignEntries({entries:j,obj:e,transformMap:r,termInfo:d})}o.revert()}async _applyEmbeddedContexts({obj:e,contextStack:r}){let n=r.length,o=e["@context"];await this._updateContextStack({contextStack:r,contexts:o});let i=r[r.length-1];return i||(i={aliases:{id:new Set,type:new Set},context:{},scopedContextMap:new Map,termMap:new Map}),{...i,revert(){r.length=n}}}async _applyTypeScopedContexts({obj:e,contextStack:r}){let n=r.length,o=r[r.length-1];o||(o={aliases:{id:new Set,type:new Set},context:{},scopedContextMap:new Map,termMap:new Map});let{aliases:i}=o,s=[],c=["@type",...i.type];for(let u of c){let d=e[u];Array.isArray(d)?s.push(...d):s.push(d)}s=[...new Set(s)].sort();let{scopedContextMap:f}=o;for(let u of s){let d=f.get(u);d&&(await this._updateContextStack({contextStack:r,contexts:d}),o=r[r.length-1],{scopedContextMap:f}=o)}return{...o,revert(){r.length=n}}}async _updateContextStack({contextStack:e,contexts:r,transformer:n}){if(!r)return;Array.isArray(r)||(r=[r]);let{contextMap:o}=this;for(let i of r){let s=o.get(i);if(!s){let h=i,y;typeof i=="string"&&(y=i,{"@context":h}=await this._getDocument({url:y})),s=await this._addContext({context:h,contextUrl:y,transformer:n})}let c={aliases:{id:new Set(s.aliases.id),type:new Set(s.aliases.type)},context:i,scopedContextMap:new Map(s.scopedContextMap),termMap:new Map(s.termMap)},f=e[e.length-1];if(e.push(c),!f)continue;let{aliases:u,termMap:d}=c;for(let h of["id","type"])for(let y of f.aliases[h])i[y]===null||c.termMap.has(y)||u[h].add(y);let{scopedContextMap:g}=c;for(let[h,y]of f.scopedContextMap)i[h]===null||g.has(h)||g.set(h,y);for(let[h,y]of f.termMap)i[h]===null||d.has(h)||d.set(h,y)}}async _addContext({context:e,contextUrl:r}){let{contextMap:n,termToId:o,idToTerm:i}=this,s=e["@import"];if(s){let g=n.get(s);if(!g){let{"@context":h}=await this._getDocument({url:s});g=await this._addContext({context:h,contextUrl:s})}e={...g.context,...e}}let c=new Map,f=new Map,u={aliases:{id:new Set,type:new Set},context:e,scopedContextMap:c,termMap:f},d=Object.keys(e).sort();for(let g of d){let h=e[g];if(!h||(h==="@id"||h.id==="@id"?u.aliases.id.add(g):(h==="@type"||h.id==="@type")&&u.aliases.type.add(g),K.has(g)))continue;if(!o.has(g)){let x=this.nextTermId;this.nextTermId+=2,o.set(g,x),i&&i.set(x,g)}f.set(g,h);let y=h["@context"];y&&c.set(g,y)}return n.set(r||e,u),u}async _getDocument({url:e}){let{document:r}=await this.documentLoader(e);return typeof r=="string"?JSON.parse(r):r}_getTermType({activeCtx:e,def:r}){let{"@type":n}=r;if(!n)return;let[o,...i]=n.split(":"),s=e.termMap.get(o);if(s===void 0)return n;if(typeof s=="string")return s+i.join(":");if(!(typeof s=="object"&&typeof s["@id"]=="string"))throw new E("ERR_INVALID_TERM_DEFINITION",'JSON-LD term definitions must be strings or objects with "@id".');return s["@id"]+i.join(":")}_getIdForTerm({term:e,plural:r}){let n=this.termToId.get(e);if(n===void 0)throw new E("ERR_UNDEFINED_TERM","CBOR-LD compression requires all terms to be defined in a JSON-LD context.");return r?n+1:n}_getTermForId({id:e}){let r=(e&1)===1;return{term:this.idToTerm.get(r?e-1:e),plural:r}}};a(de,"Transformer");var Tn=new Map([[1024,"did:v1:nym:"],[1025,"did:key:"]]),ee=class extends A{decode({value:e}={}){let r=Tn.get(e[0]);return typeof e[1]=="string"?r+=e[1]:r+=`z${Ve(e[1])}`,e.length>2&&(typeof e[2]=="string"?r+=`#${e[2]}`:r+=`#z${Ve(e[2])}`),r}static createDecoder({value:e}={}){return!(Array.isArray(e)&&e.length>1&&e.length<=3)||!Tn.has(e[0])?!1:new ee}};a(ee,"Base58DidUrlDecoder");var te=class extends A{constructor({secure:e}={}){super(),this.secure=e}decode({value:e}={}){return`${this.secure?"https://":"http://"}${e[1]}`}static createDecoder({value:e}={}){return e.length===2&&typeof e[1]=="string"?new te({secure:e[0]===2}):!1}};a(te,"HttpUrlDecoder");var An=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function bi(t){return typeof t=="string"&&An.test(t)}a(bi,"validate");var lt=bi;var I=[];for(pt=0;pt<256;++pt)I.push((pt+256).toString(16).substr(1));var pt;function Ei(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(I[t[e+0]]+I[t[e+1]]+I[t[e+2]]+I[t[e+3]]+"-"+I[t[e+4]]+I[t[e+5]]+"-"+I[t[e+6]]+I[t[e+7]]+"-"+I[t[e+8]]+I[t[e+9]]+"-"+I[t[e+10]]+I[t[e+11]]+I[t[e+12]]+I[t[e+13]]+I[t[e+14]]+I[t[e+15]]).toLowerCase();if(!lt(r))throw TypeError("Stringified UUID is invalid");return r}a(Ei,"stringify");var Ut=Ei;function Ti(t){if(!lt(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}a(Ti,"parse");var kt=Ti;var he=class extends A{decode({value:e}={}){return`urn:uuid:${typeof e[1]=="string"?e[1]:Ut(e[1])}`}static createDecoder({value:e}={}){if(e.length===2&&(typeof e[1]=="string"||e[1]instanceof Uint8Array))return new he}};a(he,"UuidUrnDecoder");var Ai=new Map([[1,te],[2,te],[3,he],[1024,ee],[1025,ee]]),re=class extends A{static createDecoder({value:e}={}){if(!(Array.isArray(e)||e.length>1))return!1;let r=Ai.get(e[0]);return r&&r.createDecoder({value:e})}};a(re,"UriDecoder");var W=class extends A{constructor({term:e}={}){super(),this.term=e}decode(){return this.term}static createDecoder({value:e,transformer:r}={}){if(Array.isArray(e))return re.createDecoder({value:e,transformer:r});let n=r.idToTerm.get(e);if(n!==void 0)return new W({term:n})}};a(W,"VocabTermDecoder");var me=class extends A{decode({value:e}={}){let r=new Date(e*1e3).toISOString();return r.substring(0,r.indexOf("T"))}static createDecoder({value:e}={}){if(typeof e=="number")return new me}};a(me,"XsdDateDecoder");var ne=class extends A{constructor({value:e}={}){super(),this.value=e}decode({value:e}={}){return typeof e=="number"?new Date(e*1e3).toISOString().replace(".000Z","Z"):new Date(e[0]*1e3+e[1]).toISOString()}static createDecoder({value:e}={}){if(typeof e=="number")return new ne;if(Array.isArray(e)&&e.length===2&&(typeof e[0]=="number"||typeof e[1]=="number"))return new ne}};a(ne,"XsdDateTimeDecoder");function oe(t,e){return JSON.stringify(t,null,2)}a(oe,"inspect");var Ci=new Map([["@id",re],["@vocab",W],["https://w3id.org/security#multibase",pe],["http://www.w3.org/2001/XMLSchema#date",me],["http://www.w3.org/2001/XMLSchema#dateTime",ne]]),Mt=K.get("@context"),Cn=Mt+1,Qe=class extends de{constructor({documentLoader:e,appContextMap:r}={}){if(super({documentLoader:e,appContextMap:r}),this.reverseAppContextMap=new Map,r)for(let[n,o]of r)this.reverseAppContextMap.set(o,n)}async decompress({compressedBytes:e,diagnose:r}={}){this.contextMap=new Map,this.termToId=new Map(K),this.nextTermId=ut,this.idToTerm=new Map;for(let[c,f]of this.termToId)this.idToTerm.set(f,c);let n=je(e,{useMaps:!0});r&&(r("Diagnostic CBOR-LD decompression transform map(s):"),r(oe(n,{depth:null,colors:!0})));let o=[],i=Array.isArray(n),s=i?n:[n];for(let c of s){let f={};await this._transform({obj:f,transformMap:c}),o.push(f)}return i?o:o[0]}_beforeObjectContexts({obj:e,transformMap:r}){let n=r.get(Mt);if(n){let i=q.createDecoder({value:n,transformer:this});e["@context"]=i?i.decode({value:n}):n}let o=r.get(Cn);if(o){if(n)throw new E("ERR_INVALID_ENCODED_CONTEXT","Both singular and plural context IDs were found in the CBOR-LD input.");if(!Array.isArray(o))throw new E("ERR_INVALID_ENCODED_CONTEXT","Encoded plural context value must be an array.");let i=[];for(let s of o){let c=q.createDecoder({value:s,transformer:this});i.push(c?c.decode({value:s}):s)}e["@context"]=i}}_beforeTypeScopedContexts({activeCtx:e,obj:r,transformMap:n}){let{termToId:o}=this,i=["@type",...e.aliases.type];for(let s of i){let c=o.get(s),f=n.get(c);if(f===void 0&&(f=n.get(c+1)),f!==void 0)if(Array.isArray(f))r[s]=f.map(u=>{let d=W.createDecoder({value:u,transformer:this});return d?d.decode({value:u}):u});else{let u=W.createDecoder({value:f,transformer:this});r[s]=u?u.decode({value:f}):f}}}_getEntries({transformMap:e,termMap:r}){let n=[];for(let[o,i]of e){if(o===Mt||o===Cn)continue;let{term:s,plural:c}=this._getTermForId({id:o});if(s===void 0)throw new E("ERR_UNKNOWN_CBORLD_TERM_ID",`Unknown term ID '${o}' was detected in the CBOR-LD input.`);let f=r.get(s);if(f===void 0&&!(s.startsWith("@")&&K.has(s)))throw new E("ERR_UNKNOWN_CBORLD_TERM",`Unknown term "${s}" was detected in the CBOR-LD input.`);n.push([{term:s,termId:o,plural:c,def:f},i])}return n.sort(Bi)}_getTermInfo({termMap:e,key:r}){let{term:n,plural:o}=this._getTermForId({id:r});if(n===void 0)throw new E("ERR_UNKNOWN_CBORLD_TERM_ID",`Unknown term ID '${r}' was detected in the CBOR-LD input.`);let i=e.get(n);if(i===void 0&&!(n.startsWith("@")&&K.has(n)))throw new E("ERR_UNKNOWN_CBORLD_TERM",`Unknown term "${n}" was detected in the CBOR-LD input.`);return{term:n,termId:r,plural:o,def:i}}_transformObjectId({obj:e,termInfo:r,value:n}){let o=re.createDecoder({value:n});e[r.term]=o?o.decode({value:n}):n}_transformObjectType({obj:e,termInfo:r,value:n}){let{term:o,plural:i}=r,s=i?n:[n],c=[];for(let f of s){let u=W.createDecoder({value:f,transformer:this});c.push(u?u.decode({value:f}):f)}e[o]=i?c:c[0]}_transformTypedValue({entries:e,termType:r,value:n}){let o=Ci.get(r),i=o&&o.createDecoder({value:n,transformer:this});if(i)return e.push(i.decode({value:n})),!0}async _transformArray({entries:e,contextStack:r,value:n}){let o=[];for(let i of n){let s={};o.push(s),await this._transform({obj:s,transformMap:i,contextStack:r})}e.push(o)}async _transformObject({entries:e,contextStack:r,value:n}){let o={};return e.push(o),this._transform({obj:o,transformMap:n,contextStack:r})}_assignEntries({entries:e,obj:r,termInfo:n}){let{term:o,plural:i}=n;r[o]=i?e:e[0]}};a(Qe,"Decompressor");function Bi([{term:t}],[{term:e}]){return t<e?-1:t>e?1:0}a(Bi,"_sortEntriesByTerm");async function Lt({cborldBytes:t,documentLoader:e,appContextMap:r=new Map,diagnose:n}){if(!(t instanceof Uint8Array))throw new TypeError('"cborldBytes" must be a Uint8Array.');let o=0;if(t[o++]!==217)throw new E("ERR_NOT_CBORLD",'CBOR-LD must start with a CBOR major type "Tag" header of `0xd9`.');if(t[o++]!==5)throw new E("ERR_NOT_CBORLD","CBOR-LD 16-bit tag must start with `0x05`.");let i=t[o];if(i===void 0)throw new E("ERR_NOT_CBORLD","Truncated CBOR-LD 16-bit tag.");if(!(i===0||i===1))throw new E("ERR_NOT_CBORLD",`Unsupported CBOR-LD compression mode "${i}".`);o++;let{buffer:s,byteOffset:c,length:f}=t,u=new Uint8Array(s,c+o,f-o);if(i===0)return je(u,{useMaps:!1});let g=await new Qe({documentLoader:e,appContextMap:r}).decompress({compressedBytes:u,diagnose:n});return n&&(n("Diagnostic JSON-LD result:"),n(oe(g,{depth:null,colors:!0}))),g}a(Lt,"decode");var b=class{encode(){throw new Error("Must be implemented by derived class.")}static createEncoder({value:e}={}){throw new Error("Must be implemented by derived class.")}};a(b,"CborldEncoder");var ye=class extends b{constructor({context:e,appContextMap:r}={}){super(),this.context=e,this.appContextMap=r}encode(){let{context:e}=this,r=Bt.get(e)||this.appContextMap.get(e);return r===void 0?new p(l.string,e):new p(l.uint,r)}static createEncoder({value:e,transformer:r}={}){if(typeof e!="string")return!1;let{appContextMap:n}=r;return new ye({context:e,appContextMap:n})}};a(ye,"ContextEncoder");var ge=class extends b{constructor({value:e}={}){super(),this.value=e}encode(){let{value:e}=this,r,n;e[0]==="z"?(r=122,n=ft(e.substr(1))):e[0]==="M"&&(r=77,n=ct.toUint8Array(e.substr(1)));let o=new Uint8Array(1+n.length);return o[0]=r,o.set(n,1),new p(l.bytes,o)}static createEncoder({value:e}={}){if(typeof e!="string")return!1;if(e[0]==="z"||e[0]==="M")return new ge({value:e})}};a(ge,"MultibaseEncoder");var Bn=new Map([["did:v1:nym:",1024],["did:key:",1025]]),ie=class extends b{constructor({value:e,scheme:r}={}){super(),this.value=e,this.scheme=r}encode(){let{value:e,scheme:r}=this,n=e.substr(r.length),[o,i]=n.split("#"),s=[new p(l.uint,Bn.get(r)),Sn(o)];return i!==void 0&&s.push(Sn(i)),[new p(l.array,s.length),s]}static createEncoder({value:e}={}){let r=[...Bn.keys()];for(let n of r)if(e.startsWith(n))return new ie({value:e,scheme:n})}};a(ie,"Base58DidUrlEncoder");function Sn(t){if(t.startsWith("z")){let e=ft(t.substr(1));if(e)return new p(l.bytes,e)}return new p(l.string,t)}a(Sn,"_multibase58ToToken");var X=class extends b{constructor({value:e,secure:r}={}){super(),this.value=e,this.secure=r}encode(){let{value:e,secure:r}=this,n=r?8:7,o=[new p(l.uint,r?2:1),new p(l.string,e.substr(n))];return[new p(l.array,o.length),o]}static createEncoder({value:e}={}){if(e.startsWith("https://"))return new X({value:e,secure:!0});if(e.startsWith("http://"))return new X({value:e,secure:!1})}};a(X,"HttpUrlEncoder");var we=class extends b{constructor({value:e}={}){super(),this.value=e}encode(){let{value:e}=this,r=e.substr(9),n=[new p(l.uint,3)];if(r.toLowerCase()===r){let o=kt(r);n.push(new p(l.bytes,o))}else n.push(new p(l.string,r));return[new p(l.array,n.length),n]}static createEncoder({value:e}={}){if(e.startsWith("urn:uuid:"))return new we({value:e})}};a(we,"UuidUrnEncoder");var Si=new Map([["http",X],["https",X],["urn:uuid",we],["did:v1:nym",ie],["did:key",ie]]),se=class extends b{static createEncoder({value:e}={}){if(typeof e!="string")return!1;let r;try{let{protocol:o,pathname:i}=new URL(e);r=o,i.includes(":")&&(r+=i);let s=e.split(":");s.pop(),r=s.join(":")}catch{return!1}let n=Si.get(r);return n&&n.createEncoder({value:e})}};a(se,"UriEncoder");var ae=class extends b{constructor({termId:e}={}){super(),this.termId=e}encode(){return new p(l.uint,this.termId)}static createEncoder({value:e,transformer:r}={}){let{termToId:n}=r,o=n.get(e);return o!==void 0?new ae({termId:o}):se.createEncoder({value:e})}};a(ae,"VocabTermEncoder");var xe=class extends b{constructor({value:e,parsed:r}={}){super(),this.value=e,this.parsed=r}encode(){let{value:e,parsed:r}=this,n=Math.floor(r/1e3),o=new Date(n*1e3).toISOString(),i=o.substring(0,o.indexOf("T"));return e!==i?new p(l.string,e):new p(l.uint,n)}static createEncoder({value:e}={}){if(e.includes("T"))return!1;let r=Date.parse(e);return isNaN(r)?!1:new xe({value:e,parsed:r})}};a(xe,"XsdDateEncoder");var ve=class extends b{constructor({value:e,parsed:r}={}){super(),this.value=e,this.parsed=r}encode(){let{value:e,parsed:r}=this,n=Math.floor(r/1e3),o=new p(l.uint,n),i=e.indexOf(".");if(i===-1){let u=new Date(n*1e3).toISOString().replace(".000Z","Z");return e!==u?new p(l.string,e):o}let s=parseInt(e.substr(i+1),10),c=new Date(n*1e3+s).toISOString();if(e!==c)return new p(l.string,e);let f=[o,new p(l.uint,s)];return[new p(l.array,f.length),f]}static createEncoder({value:e}={}){if(!e.includes("T"))return!1;let r=Date.parse(e);return isNaN(r)?!1:new ve({value:e,parsed:r})}};a(ve,"XsdDateTimeEncoder");var Oi=new Map([["@id",se],["@vocab",ae],["https://w3id.org/security#multibase",ge],["http://www.w3.org/2001/XMLSchema#date",xe],["http://www.w3.org/2001/XMLSchema#dateTime",ve]]),On=K.get("@context"),Di=On+1,Ii={Object(t){if(t instanceof b)return t.encode({obj:t})}},He=class extends de{constructor({documentLoader:e,appContextMap:r}={}){super({documentLoader:e,appContextMap:r})}async compress({jsonldDocument:e,diagnose:r}={}){let n=await this._createTransformMaps({jsonldDocument:e});return r&&(r("Diagnostic CBOR-LD compression transform map(s):"),r(oe(n,{depth:null,colors:!0}))),Pe(n,{typeEncoders:Ii})}async _createTransformMaps({jsonldDocument:e}){this.contextMap=new Map,this.termToId=new Map(K),this.nextTermId=ut;let r=[],n=Array.isArray(e),o=n?e:[e];for(let i of o){let s=new Map;await this._transform({obj:i,transformMap:s}),r.push(s)}return n?r:r[0]}_afterObjectContexts({obj:e,transformMap:r}){let n=e["@context"];if(!n)return;let o=[],i=Array.isArray(n),s=i?n:[n];for(let f of s){let u=ye.createEncoder({value:f,transformer:this});o.push(u||f)}let c=i?Di:On;r.set(c,i?o:o[0])}_getEntries({obj:e,termMap:r}){let n=[],o=Object.keys(e).sort();for(let i of o){if(i==="@context")continue;let s=r.get(i);if(s===void 0&&!(i.startsWith("@")&&K.has(i)))throw new E("ERR_UNKNOWN_CBORLD_TERM",`Unknown term '${i}' was detected in the JSON-LD input.`);let c=e[i],f=Array.isArray(c),u=this._getIdForTerm({term:i,plural:f});n.push([{term:i,termId:u,plural:f,def:s},c])}return n}_transformObjectId({transformMap:e,termInfo:r,value:n}){let{termId:o}=r,i=se.createEncoder({value:n,transformer:this,termInfo:r});e.set(o,i||n)}_transformObjectType({transformMap:e,termInfo:r,value:n}){let{termId:o,plural:i}=r,s=i?n:[n],c=[];for(let f of s){let u=ae.createEncoder({value:f,transformer:this,termInfo:r});c.push(u||f)}e.set(o,i?c:c[0])}_transformTypedValue({entries:e,termType:r,value:n,termInfo:o}){let i=Oi.get(r),s=i&&i.createEncoder({value:n,transformer:this,termInfo:o});if(s)return e.push(s),!0}async _transformArray({entries:e,contextStack:r,value:n}){let o=[];for(let i of n){let s=new Map;o.push(s),await this._transform({obj:i,transformMap:s,contextStack:r})}e.push(o)}async _transformObject({entries:e,contextStack:r,value:n}){let o=new Map;e.push(o),await this._transform({obj:n,transformMap:o,contextStack:r})}_assignEntries({entries:e,transformMap:r,termInfo:n}){let{termId:o,plural:i}=n;r.set(o,i?e:e[0])}};a(He,"Compressor");async function Nt({jsonldDocument:t,documentLoader:e,appContextMap:r=new Map,compressionMode:n=1,diagnose:o}={}){if(!(n===0||n===1))throw new TypeError('"compressionMode" must be "0" (no compression) or "1" for compression mode version 1.');let i=new Uint8Array([217,5,n]),s;n===0?s=Pe(t):s=await new He({documentLoader:e,appContextMap:r}).compress({jsonldDocument:t,diagnose:o});let c=i.length+s.length,f=new Uint8Array(c);return f.set(i),f.set(s,i.length),o&&(o("Diagnostic CBOR-LD result:"),o(oe(f,{depth:null,colors:!0}))),f}a(Nt,"encode");function Pt(t){if(t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new DataView(t.buffer,t.byteOffset,t.byteLength);if(t instanceof ArrayBuffer)return new DataView(t);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}a(Pt,"toDataView");var Ui="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",ki="0123456789ABCDEFGHIJKLMNOPQRSTUV",Mi="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Ft(t,e,r){r=r||{};let n,o;switch(e){case"RFC3548":case"RFC4648":n=Ui,o=!0;break;case"RFC4648-HEX":n=ki,o=!0;break;case"Crockford":n=Mi,o=!1;break;default:throw new Error("Unknown base32 variant: "+e)}let i=r.padding!==void 0?r.padding:o,s=Pt(t),c=0,f=0,u="";for(let d=0;d<s.byteLength;d++)for(f=f<<8|s.getUint8(d),c+=8;c>=5;)u+=n[f>>>c-5&31],c-=5;if(c>0&&(u+=n[f<<5-c&31]),i)for(;u.length%8!==0;)u+="=";return u}a(Ft,"base32Encode");var Ao=Xt(In(),1);var T;(function(t){t[t.Terminator=0]="Terminator",t[t.Numeric=1]="Numeric",t[t.Alphanumeric=2]="Alphanumeric",t[t.StructuredAppend=3]="StructuredAppend",t[t.Byte=4]="Byte",t[t.Kanji=8]="Kanji",t[t.ECI=7]="ECI"})(T||(T={}));var oo=Xt(no(),1),{__extends:ce,__assign:Ef,__rest:Tf,__decorate:Af,__param:Cf,__esDecorate:Bf,__runInitializers:Sf,__propKey:Of,__setFunctionName:Df,__metadata:If,__awaiter:Rf,__generator:Uf,__exportStar:kf,__createBinding:Mf,__values:Lf,__read:Nf,__spread:Pf,__spreadArrays:Ff,__spreadArray:$f,__await:jf,__asyncGenerator:zf,__asyncDelegator:Vf,__asyncValues:Qf,__makeTemplateObject:Hf,__importStar:Kf,__importDefault:Gf,__classPrivateFieldGet:Wf,__classPrivateFieldSet:Zf,__classPrivateFieldIn:Xf}=oo.default;var Ie=function(){function t(e,r){this.bytes=[],this.mode=e,this.data=r}return a(t,"QRData"),t.prototype.getLength=function(){return this.bytes.length},t.prototype.getLengthInBits=function(e){var r=this.mode,n=new Error("illegal mode: ".concat(r));if(1<=e&&e<10)switch(r){case T.Numeric:return 10;case T.Alphanumeric:return 9;case T.Byte:return 8;case T.Kanji:return 8;default:throw n}else if(e<27)switch(r){case T.Numeric:return 12;case T.Alphanumeric:return 11;case T.Byte:return 16;case T.Kanji:return 10;default:throw n}else if(e<41)switch(r){case T.Numeric:return 14;case T.Alphanumeric:return 13;case T.Byte:return 16;case T.Kanji:return 12;default:throw n}else throw new Error("illegal version: ".concat(e))},t}();function io(t){for(var e=0,r=t.length,n=[],o=0;o<r;o++){var i=t.charCodeAt(o);i<128?n[e++]=i:i<2048?(n[e++]=i>>6|192,n[e++]=i&63|128):(i&64512)===55296&&o+1<r&&(t.charCodeAt(o+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++o)&1023),n[e++]=i>>18|240,n[e++]=i>>12&63|128,n[e++]=i>>6&63|128,n[e++]=i&63|128):(n[e++]=i>>12|224,n[e++]=i>>6&63|128,n[e++]=i&63|128)}return n}a(io,"encode");var so=function(t){ce(e,t);function e(r,n){var o=t.call(this,T.Byte,r)||this;if(o.encoding=-1,typeof n=="function"){var i=n(r),s=i.encoding,c=i.bytes;o.bytes=c,o.encoding=s}else o.bytes=io(r),o.encoding=26;return o}return a(e,"QRByte"),e.prototype.writeTo=function(r){for(var n=this.bytes,o=0,i=n;o<i.length;o++){var s=i[o];r.put(s,8)}},e}(Ie);var _e=[],jt=[];for(R=0;R<256;R++)jt[R]=0,_e[R]=R<8?1<<R:_e[R-4]^_e[R-5]^_e[R-6]^_e[R-8];var R;for(R=0;R<255;R++)jt[_e[R]]=R;var R;function Re(t){if(t<1)throw new Error("illegal log: ".concat(t));return jt[t]}a(Re,"glog");function Ke(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return _e[t]}a(Ke,"gexp");var Ge=function(){function t(e,r){r===void 0&&(r=0);for(var n=0,o=e.length;n<o&&e[n]===0;)n++;o-=n;for(var i=[],s=0;s<o;s++)i.push(e[n+s]);for(var s=0;s<r;s++)i.push(0);this.num=i}return a(t,"Polynomial"),t.prototype.getAt=function(e){return this.num[e]},t.prototype.getLength=function(){return this.num.length},t.prototype.multiply=function(e){for(var r=[],n=e.getLength(),o=this.getLength(),i=o+n-1,s=0;s<i;s++)r.push(0);for(var s=0;s<o;s++)for(var c=0;c<n;c++)r[s+c]^=Ke(Re(this.getAt(s))+Re(e.getAt(c)));return new t(r)},t.prototype.mod=function(e){var r=e.getLength(),n=this.getLength();if(n-r<0)return this;for(var o=Re(this.getAt(0))-Re(e.getAt(0)),i=[],s=0;s<n;s++)i.push(this.getAt(s));for(var s=0;s<r;s++)i[s]^=Ke(Re(e.getAt(s))+o);return new t(i).mod(e)},t}();var $i=3,ji=3,ao=40,zi=10,Vi=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],Qi=1<<14|1<<12|1<<10|1<<4|1<<1,lo=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,po=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0;function ho(t){return Vi[t-1]}a(ho,"getAlignmentPattern");function mo(t){for(var e=new Ge([1]),r=0;r<t;r++)e=e.multiply(new Ge([1,Ke(r)]));return e}a(mo,"getErrorCorrectionPolynomial");function Ue(t){for(var e=0;t!==0;)e++,t>>>=1;return e}a(Ue,"getBCHDigit");var co=Ue(po);function yo(t){for(var e=t<<12;Ue(e)-co>=0;)e^=po<<Ue(e)-co;return t<<12|e}a(yo,"getBCHVersion");var fo=Ue(lo);function go(t){for(var e=t<<10;Ue(e)-fo>=0;)e^=lo<<Ue(e)-fo;return(t<<10|e)^Qi}a(go,"getBCHVersionInfo");function uo(t,e){for(var r=t.getMatrixSize(),n=0,o=0;o<r;o++)for(var i=!1,s=0,c=0;c<r;c++){var f=e?t.isDark(o,c):t.isDark(c,o);f===i?(s++,s===5?n+=$i:s>5&&n++):(i=f,s=1)}return n}a(uo,"applyMaskPenaltyRule1Internal");function Hi(t){return uo(t,!0)+uo(t,!1)}a(Hi,"applyMaskPenaltyRule1");function Ki(t){for(var e=t.getMatrixSize(),r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var i=t.isDark(n,o);i===t.isDark(n,o+1)&&i===t.isDark(n+1,o)&&i===t.isDark(n+1,o+1)&&(r+=ji)}return r}a(Ki,"applyMaskPenaltyRule2");function yt(t,e,r,n,o){r=Math.max(r,0),n=Math.min(n,t.getMatrixSize());for(var i=r;i<n;i++){var s=o?t.isDark(e,i):t.isDark(i,e);if(s)return!1}return!0}a(yt,"isFourWhite");function Gi(t){for(var e=t.getMatrixSize(),r=0,n=0;n<e;n++)for(var o=0;o<e;o++)o+6<e&&t.isDark(n,o)&&!t.isDark(n,o+1)&&t.isDark(n,o+2)&&t.isDark(n,o+3)&&t.isDark(n,o+4)&&!t.isDark(n,o+5)&&t.isDark(n,o+6)&&(yt(t,n,o-4,o,!0)||yt(t,n,o+7,o+11,!0))&&(r+=ao),n+6<e&&t.isDark(n,o)&&!t.isDark(n+1,o)&&t.isDark(n+2,o)&&t.isDark(n+3,o)&&t.isDark(n+4,o)&&!t.isDark(n+5,o)&&t.isDark(n+6,o)&&(yt(t,o,n-4,n,!1)||yt(t,o,n+7,n+11,!1))&&(r+=ao);return r}a(Gi,"applyMaskPenaltyRule3");function Wi(t){for(var e=t.getMatrixSize(),r=0,n=0;n<e;n++)for(var o=0;o<e;o++)t.isDark(n,o)&&r++;var i=e*e,s=Math.floor(Math.abs(r*20-i*10)/i);return s*zi}a(Wi,"applyMaskPenaltyRule4");function wo(t){return Hi(t)+Ki(t)+Gi(t)+Wi(t)}a(wo,"calculateMaskPenalty");var P;(function(t){t[t.L=1]="L",t[t.M=0]="M",t[t.Q=3]="Q",t[t.H=2]="H"})(P||(P={}));var xo=function(){function t(e,r){this.dataCount=r,this.totalCount=e}return a(t,"RSBlock"),t.prototype.getDataCount=function(){return this.dataCount},t.prototype.getTotalCount=function(){return this.totalCount},t.getRSBlocks=function(e,r){for(var n=[],o=t.getRSBlockTable(e,r),i=o.length/3,s=0;s<i;s++)for(var c=o[s*3+0],f=o[s*3+1],u=o[s*3+2],d=0;d<c;d++)n.push(new t(f,u));return n},t.getRSBlockTable=function(e,r){switch(r){case P.L:return t.RS_BLOCK_TABLE[(e-1)*4+0];case P.M:return t.RS_BLOCK_TABLE[(e-1)*4+1];case P.Q:return t.RS_BLOCK_TABLE[(e-1)*4+2];case P.H:return t.RS_BLOCK_TABLE[(e-1)*4+3];default:throw new Error("illegal error correction level: ".concat(r))}},t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t}();var zt=function(){function t(){this.length=0,this.buffer=[]}return a(t,"BitBuffer"),t.prototype.getBuffer=function(){return this.buffer},t.prototype.getLengthInBits=function(){return this.length},t.prototype.getBit=function(e){return(this.buffer[e/8>>0]>>>7-e%8&1)===1},t.prototype.put=function(e,r){for(var n=0;n<r;n++)this.putBit((e>>>r-n-1&1)===1)},t.prototype.putBit=function(e){var r=this.buffer;this.length===r.length*8&&r.push(0),e&&(r[this.length/8>>0]|=128>>>this.length%8),this.length++},t}();var gt=function(){function t(){}return a(t,"OutputStream"),t.prototype.writeBytes=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=e.length);for(var o=0;o<n;o++)this.writeByte(e[o+r])},t.prototype.flush=function(){},t.prototype.close=function(){this.flush()},t}();var wt=function(t){ce(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.bytes=[],r}return a(e,"ByteArrayOutputStream"),e.prototype.writeByte=function(r){this.bytes.push(r)},e.prototype.writeInt16=function(r){this.bytes.push(r,r>>>8)},e.prototype.toByteArray=function(){return this.bytes},e}(gt);function Zi(t){if(t>=0){if(t<26)return 65+t;if(t<52)return 97+(t-26);if(t<62)return 48+(t-52);if(t===62)return 43;if(t===63)return 47}throw new Error("illegal char: ".concat(String.fromCharCode(t)))}a(Zi,"encode");var vo=function(t){ce(e,t);function e(r){var n=t.call(this)||this;return n.buffer=0,n.length=0,n.bufLength=0,n.stream=r,n}return a(e,"Base64EncodeOutputStream"),e.prototype.writeByte=function(r){for(this.buffer=this.buffer<<8|r&255,this.bufLength+=8,this.length++;this.bufLength>=6;)this.writeEncoded(this.buffer>>>this.bufLength-6),this.bufLength-=6},e.prototype.flush=function(){this.bufLength>0&&(this.writeEncoded(this.buffer<<6-this.bufLength),this.buffer=0,this.bufLength=0);var r=this.stream;if(this.length%3!=0)for(var n=3-this.length%3,o=0;o<n;o++)r.writeByte(61)},e.prototype.writeEncoded=function(r){this.stream.writeByte(Zi(r&63))},e}(gt);function Xi(t){var e=new wt,r=new vo(e);return r.writeBytes(t),r.close(),e.close(),e.toByteArray()}a(Xi,"encodeToBase64");var Ji=function(){function t(){this.size=0,this.map={}}return a(t,"LZWTable"),t.prototype.add=function(e){this.contains(e)||(this.map[e]=this.size++)},t.prototype.getSize=function(){return this.size},t.prototype.indexOf=function(e){return this.map[e]},t.prototype.contains=function(e){return this.map[e]>=0},t}(),Yi=function(){function t(e){this.output=e,this.bitLength=0,this.bitBuffer=0}return a(t,"BitOutputStream"),t.prototype.write=function(e,r){if(e>>>r!==0)throw new Error("length overflow");for(var n=this.output;this.bitLength+r>=8;)n.writeByte(255&(e<<this.bitLength|this.bitBuffer)),r-=8-this.bitLength,e>>>=8-this.bitLength,this.bitBuffer=0,this.bitLength=0;this.bitBuffer=e<<this.bitLength|this.bitBuffer,this.bitLength=this.bitLength+r},t.prototype.flush=function(){var e=this.output;this.bitLength>0&&e.writeByte(this.bitBuffer),e.flush()},t.prototype.close=function(){this.flush(),this.output.close()},t}(),_o=function(){function t(e,r){this.data=[],this.width=e,this.height=r;for(var n=e*r,o=0;o<n;o++)this.data[o]=0}return a(t,"GIFImage"),t.prototype.getLZWRaster=function(e){for(var r=new Ji,n=String.fromCharCode,o=1<<e,i=(1<<e)+1,s=0;s<o;s++)r.add(n(s));r.add(n(o)),r.add(n(i));var c=e+1,f=new wt,u=new Yi(f);try{var d=this.data,g=d.length,h=String.fromCharCode;u.write(o,c);for(var y=0,x=h(d[y++]);y<g;){var v=h(d[y++]);r.contains(x+v)?x+=v:(u.write(r.indexOf(x),c),r.getSize()<4095&&(r.getSize()===1<<c&&c++,r.add(x+v)),x=v)}u.write(r.indexOf(x),c),u.write(i,c)}finally{u.close()}return f.toByteArray()},t.prototype.setPixel=function(e,r,n){var o=this,i=o.width,s=o.height;if(e<0||i<=e)throw new Error("illegal x axis: ".concat(e));if(r<0||s<=r)throw new Error("illegal y axis: ".concat(r));this.data[r*i+e]=n},t.prototype.getPixel=function(e,r){var n=this,o=n.width,i=n.height;if(e<0||o<=e)throw new Error("illegal x axis: ".concat(e));if(r<0||i<=r)throw new Error("illegal y axis: ".concat(r));return this.data[r*o+e]},t.prototype.write=function(e){var r=this,n=r.width,o=r.height;e.writeByte(71),e.writeByte(73),e.writeByte(70),e.writeByte(56),e.writeByte(55),e.writeByte(97),e.writeInt16(n),e.writeInt16(o),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeByte(44),e.writeInt16(0),e.writeInt16(0),e.writeInt16(n),e.writeInt16(o),e.writeByte(0);var i=2,s=this.getLZWRaster(i),c=s.length;e.writeByte(i);for(var f=0;c-f>255;)e.writeByte(255),e.writeBytes(s,f,255),f+=255;var u=c-f;e.writeByte(u),e.writeBytes(s,f,u),e.writeByte(0),e.writeByte(59)},t.prototype.toDataURL=function(){var e=new wt;this.write(e);var r=Xi(e.toByteArray());e.close();for(var n=r.length,o=String.fromCharCode,i="data:image/gif;base64,",s=0;s<n;s++)i+=o(r[s]);return i},t}();function bo(t){switch(t){case 0:return function(e,r){return(e+r&1)===0};case 1:return function(e,r){return(r&1)===0};case 2:return function(e,r){return e%3===0};case 3:return function(e,r){return(e+r)%3===0};case 4:return function(e,r){return((e/3>>0)+(r/2>>0)&1)===0};case 5:return function(e,r){return(e*r&1)+e*r%3===0};case 6:return function(e,r){return((e*r&1)+e*r%3&1)===0};case 7:return function(e,r){return(e*r%3+(e+r&1)&1)===0};default:throw new Error("illegal mask: ".concat(t))}}a(bo,"getMaskFunc");var qi=236,es=17,ts=Object.prototype.toString;function rs(t,e){if(t<0||t>=1e6)throw new Error("byte mode encoding hint out of range");e.put(T.ECI,4),t<1<<7?e.put(t,8):t<1<<14?(e.put(2,2),e.put(t,14)):(e.put(6,3),e.put(t,21))}a(rs,"appendECI");function Eo(t,e,r,n){for(var o=new zt,i=xo.getRSBlocks(t,e),s=0,c=n;s<c.length;s++){var f=c[s],u=f.mode;r&&u===T.Byte&&rs(f.encoding,o),o.put(u,4),o.put(f.getLength(),f.getLengthInBits(t)),f.writeTo(o)}for(var d=0,g=0,h=i;g<h.length;g++){var y=h[g];d+=y.getDataCount()}return d*=8,[o,i,d]}a(Eo,"prepareData");function ns(t,e){for(var r=0,n=0,o=0,i=[],s=[],c=e.length,f=t.getBuffer(),u=0;u<c;u++){var d=e[u],g=d.getDataCount(),h=d.getTotalCount()-g;n=Math.max(n,g),o=Math.max(o,h),i[u]=[];for(var y=0;y<g;y++)i[u][y]=255&f[y+r];r+=g;var x=mo(h),v=x.getLength()-1,B=new Ge(i[u],v),U=B.mod(x),F=U.getLength();s[u]=[];for(var y=0;y<v;y++){var $=y+F-v;s[u][y]=$>=0?U.getAt($):0}}t=new zt;for(var y=0;y<n;y++)for(var u=0;u<c;u++)y<i[u].length&&t.put(i[u][y],8);for(var y=0;y<o;y++)for(var u=0;u<c;u++)y<s[u].length&&t.put(s[u][y],8);return t}a(ns,"createBytes");function os(t,e,r){for(t.getLengthInBits()+4<=r&&t.put(0,4);t.getLengthInBits()%8!==0;)t.putBit(!1);for(;!(t.getLengthInBits()>=r||(t.put(qi,8),t.getLengthInBits()>=r));)t.put(es,8);return ns(t,e)}a(os,"createData");var Vt=function(){function t(e){e===void 0&&(e={}),this.matrixSize=0,this.chunks=[],this.matrix=[];var r=e.version,n=r===void 0?0:r,o=e.encodingHint,i=o===void 0?!1:o,s=e.errorCorrectionLevel,c=s===void 0?P.L:s;this.setVersion(n),this.setEncodingHint(i),this.setErrorCorrectionLevel(c)}return a(t,"Encoder"),t.prototype.getMatrix=function(){return this.matrix},t.prototype.getMatrixSize=function(){return this.matrixSize},t.prototype.getVersion=function(){return this.version},t.prototype.setVersion=function(e){return this.version=Math.min(40,Math.max(0,e>>0)),this.auto=this.version===0,this},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.setErrorCorrectionLevel=function(e){switch(e){case P.L:case P.M:case P.Q:case P.H:this.errorCorrectionLevel=e}return this},t.prototype.getEncodingHint=function(){return this.encodingHint},t.prototype.setEncodingHint=function(e){return this.encodingHint=e,this},t.prototype.write=function(e){var r=this.chunks;if(e instanceof Ie)r.push(e);else{var n=ts.call(e);if(n==="[object String]")r.push(new so(e));else throw new Error("illegal data: ".concat(e))}return this},t.prototype.isDark=function(e,r){return this.matrix[e][r]===!0},t.prototype.setupFinderPattern=function(e,r){for(var n=this.matrix,o=this.matrixSize,i=-1;i<=7;i++)for(var s=-1;s<=7;s++)e+i<=-1||o<=e+i||r+s<=-1||o<=r+s||(0<=i&&i<=6&&(s===0||s===6)||0<=s&&s<=6&&(i===0||i===6)||2<=i&&i<=4&&2<=s&&s<=4?n[e+i][r+s]=!0:n[e+i][r+s]=!1)},t.prototype.setupAlignmentPattern=function(){for(var e=this.matrix,r=ho(this.version),n=r.length,o=0;o<n;o++)for(var i=0;i<n;i++){var s=r[o],c=r[i];if(e[s][c]===null)for(var f=-2;f<=2;f++)for(var u=-2;u<=2;u++)f===-2||f===2||u===-2||u===2||f===0&&u===0?e[s+f][c+u]=!0:e[s+f][c+u]=!1}},t.prototype.setupTimingPattern=function(){for(var e=this.matrix,r=this.matrixSize-8,n=8;n<r;n++){var o=n%2===0;e[n][6]===null&&(e[n][6]=o),e[6][n]===null&&(e[6][n]=o)}},t.prototype.setupFormatInfo=function(e){for(var r=this.matrix,n=this.errorCorrectionLevel<<3|e,o=go(n),i=this.matrixSize,s=0;s<15;s++){var c=(o>>s&1)===1;s<6?r[s][8]=c:s<8?r[s+1][8]=c:r[i-15+s][8]=c,s<8?r[8][i-s-1]=c:s<9?r[8][15-s-1+1]=c:r[8][15-s-1]=c}r[i-8][8]=!0},t.prototype.setupVersionInfo=function(){if(this.version>=7)for(var e=this.matrix,r=this.matrixSize,n=yo(this.version),o=0;o<18;o++){var i=(n>>o&1)===1;e[o/3>>0][o%3+r-8-3]=i,e[o%3+r-8-3][o/3>>0]=i}},t.prototype.setupCodewords=function(e,r){for(var n=this.matrix,o=this.matrixSize,i=e.getLengthInBits(),s=bo(r),c=0,f=o-1;f>=1;f-=2){f===6&&(f=5);for(var u=0;u<o;u++)for(var d=0;d<2;d++){var g=f-d,h=(f+1&2)===0,y=h?o-1-u:u;if(n[y][g]===null){var x=!1;c<i&&(x=e.getBit(c++));var v=s(g,y);v&&(x=!x),n[y][g]=x}}}},t.prototype.buildMatrix=function(e,r){for(var n=[],o=this.matrixSize,i=0;i<o;i++){n[i]=[];for(var s=0;s<o;s++)n[i][s]=null}this.matrix=n,this.setupFinderPattern(0,0),this.setupFinderPattern(o-7,0),this.setupFinderPattern(0,o-7),this.setupAlignmentPattern(),this.setupTimingPattern(),this.setupFormatInfo(r),this.setupVersionInfo(),this.setupCodewords(e,r)},t.prototype.make=function(){var e,r,n,o,i,s=this,c=s.chunks,f=s.errorCorrectionLevel;if(this.auto){for(var u=1;u<=40&&(e=Eo(u,f,this.encodingHint,c),n=e[0],o=e[1],i=e[2],!(n.getLengthInBits()<=i));u++);var d=n.getLengthInBits();if(d>i)throw new Error("data overflow: ".concat(d," > ").concat(i));this.version=u}else r=Eo(this.version,f,this.encodingHint,c),n=r[0],o=r[1],i=r[2];this.matrixSize=this.version*4+17;for(var g=[],h=os(n,o,i),y=-1,x=Number.MAX_VALUE,v=0;v<8;v++){this.buildMatrix(h,v),g.push(this.matrix);var B=wo(this);B<x&&(x=B,y=v)}return this.matrix=g[y],this},t.prototype.toDataURL=function(e,r){e===void 0&&(e=2),r===void 0&&(r=e*4),e=Math.max(1,e>>0),r=Math.max(0,r>>0);for(var n=this.matrixSize,o=e*n+r*2,i=r,s=o-r,c=new _o(o,o),f=0;f<o;f++)for(var u=0;u<o;u++)if(i<=u&&u<s&&i<=f&&f<s){var d=(f-i)/e>>0,g=(u-i)/e>>0;c.setPixel(u,f,this.isDark(d,g)?0:1)}else c.setPixel(u,f,1);return c.toDataURL()},t.prototype.clear=function(){this.chunks=[]},t}();function To(t){for(var e=t.length,r=[],n=0;n<e;n++)r.push(t.charCodeAt(n));return r}a(To,"encode");function Qt(t){if(48<=t&&t<=57)return t-48;if(65<=t&&t<=90)return t-65+10;switch(t){case 32:return 36;case 36:return 37;case 37:return 38;case 42:return 39;case 43:return 40;case 45:return 41;case 46:return 42;case 47:return 43;case 58:return 44;default:throw new Error("illegal char: ".concat(String.fromCharCode(t)))}}a(Qt,"getByte");var Ht=function(t){ce(e,t);function e(r){var n=t.call(this,T.Alphanumeric,r)||this;return n.bytes=To(r),n}return a(e,"QRAlphanumeric"),e.prototype.writeTo=function(r){for(var n=0,o=this.bytes,i=o.length;n+1<i;)r.put(Qt(o[n])*45+Qt(o[n+1]),11),n+=2;n<i&&r.put(Qt(o[n]),6)},e}(Ie);var Co="VP1",Bo="B";function is({bytes:t,size:e}){let r=new Vt;r.setEncodingHint(!0);let n=Ft(t,"RFC4648",{padding:!1}),o=`${Co}-${Bo}${n}`;return r.write(new Ht(o)),r.make(),{payload:o,encodedCborld:n,version:r.getVersion(),imageDataUrl:r.toDataURL(e)}}a(is,"_bytesToQrCodeDataUrl");async function Kt({vp:t,documentLoader:e,size:r,diagnose:n}={}){let o=await Nt({jsonldDocument:t,documentLoader:e,diagnose:n}),{payload:i,imageDataUrl:s,encodedCborld:c,version:f}=is({bytes:o,size:r});return{payload:i,imageDataUrl:s,encodedCborld:c,rawCborldBytes:o,version:f}}a(Kt,"toQrCode");async function Gt({text:t,documentLoader:e,diagnose:r}={}){let n=Co+"-";if(!(t&&t.startsWith(n)))throw TypeError("Unsupported VP QR format.");let o=t.slice(n.length);if(!o.startsWith(Bo))throw TypeError("Payload must be multibase base32 (RFC4648) encoded.");let i=(0,Ao.default)(o.slice(1),"RFC4648"),s=new Uint8Array(i);return{vp:await Lt({cborldBytes:s,documentLoader:e,diagnose:r})}}a(Gt,"fromQrCode");var ss=a(t=>({name:"Vpqr",displayName:"VP QR",description:"Allows reading and creating QR codes with Verifiable Presentations in them",methods:{vpFromQrCode:async(e,r)=>(await Gt({text:r,documentLoader:async n=>({document:await t.invoke.contextLoader(n)})}))?.vp,vpToQrCode:async(e,r)=>(await Kt({vp:r,documentLoader:async n=>({document:await t.invoke.contextLoader(n)})}))?.imageDataUrl}}),"getVpqrPlugin");
3
+ /*!
4
+ * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
5
+ */
6
+ /*!
7
+ * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.
8
+ */
9
+ /*!
10
+ * Copyright (c) 2020-2021 Digital Bazaar, Inc. All rights reserved.
11
+ */
12
+ /*!
13
+ * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
14
+ */
15
+ /**
16
+ * @module QRCode
17
+ * @package @nuintun/qrcode
18
+ * @license MIT
19
+ * @version 3.3.0
20
+ * @author nuintun <nuintun@qq.com>
21
+ * @description A pure JavaScript QRCode encode and decode library.
22
+ * @see https://github.com/nuintun/qrcode#readme
23
+ */
24
+ //# sourceMappingURL=vpqr-plugin.cjs.production.min.js.map